void _CORE_message_queue_Close(
  CORE_message_queue_Control *the_message_queue,
  Thread_queue_Flush_callout  remote_extract_callout,
  uint32_t                    status
)
{

  /*
   *  This will flush blocked threads whether they were blocked on
   *  a send or receive.
   */

  _Thread_queue_Flush(
    &the_message_queue->Wait_queue,
    remote_extract_callout,
    status
  );

  /*
   *  This removes all messages from the pending message queue.  Since
   *  we just flushed all waiting threads, we don't have to worry about
   *  the flush satisfying any blocked senders as a side-effect.
   */

  if ( the_message_queue->number_of_pending_messages != 0 )
    (void) _CORE_message_queue_Flush_support( the_message_queue );

  (void) _Workspace_Free( the_message_queue->message_buffers );

}
Exemple #2
0
void _CORE_mutex_Flush(
  CORE_mutex_Control         *the_mutex,
  Thread_queue_Flush_callout  remote_extract_callout,
  uint32_t                    status
)
{
  _Thread_queue_Flush(
    &the_mutex->Wait_queue,
    remote_extract_callout,
    status
  );
}
Exemple #3
0
void _CORE_semaphore_Flush(
  CORE_semaphore_Control     *the_semaphore,
  Thread_queue_Flush_callout  remote_extract_callout,
  uint32_t                    status
)
{

  _Thread_queue_Flush(
    &the_semaphore->Wait_queue,
    remote_extract_callout,
    status
  );

}
Exemple #4
0
  void _CORE_message_queue_Flush_waiting_threads(
    CORE_message_queue_Control *the_message_queue
  )
  {
    /* XXX this is not supported for global message queues */

    /*
     *  IF there are no pending messages,
     *  THEN threads may be blocked waiting to RECEIVE a message,
     *
     *  IF the pending message queue is full
     *  THEN threads may be blocked waiting to SEND a message
     *
     *  But in either case, we will return "unsatisfied nowait"
     *  to indicate that the blocking condition was not satisfied
     *  and that the blocking state was canceled.
     */

    _Thread_queue_Flush(
      &the_message_queue->Wait_queue,
      NULL,
      CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT
    );
  }