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/score/inline/rtems/score/coremsg.inl | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'cpukit/score/inline') diff --git a/cpukit/score/inline/rtems/score/coremsg.inl b/cpukit/score/inline/rtems/score/coremsg.inl index af16fbd4aa..7356ce9537 100644 --- a/cpukit/score/inline/rtems/score/coremsg.inl +++ b/cpukit/score/inline/rtems/score/coremsg.inl @@ -27,15 +27,17 @@ * This routine sends a message to the end of the specified message queue. */ -RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send( +RTEMS_INLINE_ROUTINE void _CORE_message_queue_Send( CORE_message_queue_Control *the_message_queue, void *buffer, unsigned32 size, Objects_Id id, - CORE_message_queue_API_mp_support_callout api_message_queue_mp_support + CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, + boolean wait, + Watchdog_Interval timeout ) { - return _CORE_message_queue_Submit( + _CORE_message_queue_Submit( the_message_queue, buffer, size, @@ -45,7 +47,9 @@ RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send( #else NULL, #endif - CORE_MESSAGE_QUEUE_SEND_REQUEST + CORE_MESSAGE_QUEUE_SEND_REQUEST, + wait, /* sender may block */ + timeout /* timeout interval */ ); } @@ -58,15 +62,17 @@ RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Send( * This routine sends a message to the front of the specified message queue. */ -RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent( +RTEMS_INLINE_ROUTINE void _CORE_message_queue_Urgent( CORE_message_queue_Control *the_message_queue, void *buffer, unsigned32 size, Objects_Id id, - CORE_message_queue_API_mp_support_callout api_message_queue_mp_support + CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, + boolean wait, + Watchdog_Interval timeout ) { - return _CORE_message_queue_Submit( + _CORE_message_queue_Submit( the_message_queue, buffer, size, @@ -76,7 +82,9 @@ RTEMS_INLINE_ROUTINE CORE_message_queue_Status _CORE_message_queue_Urgent( #else NULL, #endif - CORE_MESSAGE_QUEUE_URGENT_REQUEST + CORE_MESSAGE_QUEUE_URGENT_REQUEST, + wait, /* sender may block */ + timeout /* timeout interval */ ); } -- cgit v1.2.3