From 53fb837afc4285486e318bcb614c911bbe9b1348 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 13 Jan 2000 19:25:15 +0000 Subject: POSIX message queues now include complete functionality including blocking sends when the queue is full. The SuperCore was enhanced to support blocking on send. The existing POSIX API was debugged and numerous test cases were added to psxmsgq01 by Jennifer Averett. SuperCore enhancements and resulting modifications to other APIs were done by Joel. There is one significant point of interpretation for the POSIX API. What happens to threads already blocked on a message queue when the mode of that same message queue is changed from blocking to non-blocking? We decided to unblock all waiting tasks with an EAGAIN error just as if a non-blocking version of the same operation had returned unsatisfied. This case is not discussed in the POSIX standard and other implementations may have chosen differently. --- cpukit/rtems/src/msgqcreate.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cpukit/rtems/src/msgqcreate.c') diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c index 395cbf3a02..24bc35993d 100644 --- a/cpukit/rtems/src/msgqcreate.c +++ b/cpukit/rtems/src/msgqcreate.c @@ -59,7 +59,7 @@ rtems_status_code rtems_message_queue_create( ) { register Message_queue_Control *the_message_queue; - CORE_message_queue_Attributes the_message_queue_attributes; + CORE_message_queue_Attributes the_msgq_attributes; void *handler; #if defined(RTEMS_MULTIPROCESSING) boolean is_global; @@ -74,10 +74,10 @@ rtems_status_code rtems_message_queue_create( return RTEMS_MP_NOT_CONFIGURED; #endif - if (count == 0) + if ( count == 0 ) return RTEMS_INVALID_NUMBER; - if (max_message_size == 0) + if ( max_message_size == 0 ) return RTEMS_INVALID_SIZE; #if defined(RTEMS_MULTIPROCESSING) @@ -115,11 +115,9 @@ rtems_status_code rtems_message_queue_create( the_message_queue->attribute_set = attribute_set; if (_Attributes_Is_priority( attribute_set ) ) - the_message_queue_attributes.discipline = - CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; + the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; else - the_message_queue_attributes.discipline = - CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; + the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; handler = NULL; #if defined(RTEMS_MULTIPROCESSING) @@ -129,7 +127,7 @@ rtems_status_code rtems_message_queue_create( if ( ! _CORE_message_queue_Initialize( &the_message_queue->message_queue, OBJECTS_RTEMS_MESSAGE_QUEUES, - &the_message_queue_attributes, + &the_msgq_attributes, count, max_message_size, handler ) ) { -- cgit v1.2.3