From d65c376845847ea7a697904b5222c39331bd56ec Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Thu, 13 Jan 2000 18:32:09 +0000 Subject: + Added and yellow line tested _CORE_message_queue_Flush_waiting_threads and _CORE_message_queue_Insert_message for posix message queues. + Yellow line tested new source --- c/src/exec/score/src/coremsgflushwait.c | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 c/src/exec/score/src/coremsgflushwait.c (limited to 'c/src/exec/score/src/coremsgflushwait.c') diff --git a/c/src/exec/score/src/coremsgflushwait.c b/c/src/exec/score/src/coremsgflushwait.c new file mode 100644 index 0000000000..bda8143ffd --- /dev/null +++ b/c/src/exec/score/src/coremsgflushwait.c @@ -0,0 +1,70 @@ +/* + * CORE Message Queue Handler + * + * DESCRIPTION: + * + * This package is the implementation of the CORE Message Queue Handler. + * This core object provides task synchronization and communication functions + * via messages passed to queue objects. + * + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(RTEMS_MULTIPROCESSING) +#include +#endif + +/*PAGE + * + * _CORE_message_queue_Flush_waiting_threads + * + * This function flushes the message_queue's task wait queue. The number + * of messages flushed from the queue is returned. + * + * Input parameters: + * the_message_queue - the message_queue to be flushed + * + * Output parameters: + * returns - the number of messages flushed from the queue + */ + +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 + ); +} + -- cgit v1.2.3