summaryrefslogtreecommitdiffstats
path: root/c/src/exec/posix
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-04-26 23:39:01 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-04-26 23:39:01 +0000
commit53092d19211054d67787990714798c2e72c8a623 (patch)
tree9386e2095e8fd1d9c3e419faae2006df2ec80a48 /c/src/exec/posix
parent2001-04-26 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-53092d19211054d67787990714798c2e72c8a623.tar.bz2
2001-04-26 Joel Sherrill <joel@OARcorp.com>
* include/rtems/posix/mqueue.h, inline/rtems/posix/mqueue.inl, src/mqueue.c, src/mqueueclose.c, src/mqueuecreatesupp.c, src/mqueuegetattr.c, src/mqueuenotify.c, src/mqueueopen.c, src/mqueuerecvsupp.c, src/mqueuesendsupp.c, src/mqueuesetattr.c: Per PR81 reworked to add a message queue descriptor separate from the underlying message queue. This allows non-blocking to follow the "open" not the underlying queue.
Diffstat (limited to 'c/src/exec/posix')
-rw-r--r--c/src/exec/posix/ChangeLog10
-rw-r--r--c/src/exec/posix/include/rtems/posix/mqueue.h15
-rw-r--r--c/src/exec/posix/inline/rtems/posix/mqueue.inl41
-rw-r--r--c/src/exec/posix/src/mqueue.c10
-rw-r--r--c/src/exec/posix/src/mqueueclose.c23
-rw-r--r--c/src/exec/posix/src/mqueuecreatesupp.c7
-rw-r--r--c/src/exec/posix/src/mqueuegetattr.c12
-rw-r--r--c/src/exec/posix/src/mqueuenotify.c9
-rw-r--r--c/src/exec/posix/src/mqueueopen.c52
-rw-r--r--c/src/exec/posix/src/mqueuerecvsupp.c15
-rw-r--r--c/src/exec/posix/src/mqueuesendsupp.c16
-rw-r--r--c/src/exec/posix/src/mqueuesetattr.c33
12 files changed, 168 insertions, 75 deletions
diff --git a/c/src/exec/posix/ChangeLog b/c/src/exec/posix/ChangeLog
index 9e427bccb6..70c30c603e 100644
--- a/c/src/exec/posix/ChangeLog
+++ b/c/src/exec/posix/ChangeLog
@@ -1,3 +1,13 @@
+2001-04-26 Joel Sherrill <joel@OARcorp.com>
+
+ * include/rtems/posix/mqueue.h, inline/rtems/posix/mqueue.inl,
+ src/mqueue.c, src/mqueueclose.c, src/mqueuecreatesupp.c,
+ src/mqueuegetattr.c, src/mqueuenotify.c, src/mqueueopen.c,
+ src/mqueuerecvsupp.c, src/mqueuesendsupp.c, src/mqueuesetattr.c:
+ Per PR81 reworked to add a message queue descriptor separate from
+ the underlying message queue. This allows non-blocking to follow
+ the "open" not the underlying queue.
+
2002-04-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* src/psignal.c: Include <stdlib.h>.
diff --git a/c/src/exec/posix/include/rtems/posix/mqueue.h b/c/src/exec/posix/include/rtems/posix/mqueue.h
index 6b2cb9e464..076ea1d6c2 100644
--- a/c/src/exec/posix/include/rtems/posix/mqueue.h
+++ b/c/src/exec/posix/include/rtems/posix/mqueue.h
@@ -34,18 +34,25 @@ typedef struct {
int process_shared;
boolean named;
boolean linked;
- int oflag;
unsigned32 open_count;
CORE_message_queue_Control Message_queue;
struct sigevent notification;
} POSIX_Message_queue_Control;
+typedef struct {
+ Objects_Control Object;
+ POSIX_Message_queue_Control *Queue;
+ int oflag;
+} POSIX_Message_queue_Control_fd;
+
/*
* The following defines the information control block used to manage
- * this class of objects.
+ * this class of objects. The second item is used to manage the set
+ * of "file descriptors" associated with the message queues.
*/
POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
+POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds;
/*
* _POSIX_Message_queue_Manager_initialization
@@ -72,7 +79,6 @@ void _POSIX_Message_queue_Manager_initialization(
int _POSIX_Message_queue_Create_support(
const char *name,
int pshared,
- unsigned int oflag,
struct mq_attr *attr,
POSIX_Message_queue_Control **message_queue
);
@@ -182,7 +188,8 @@ RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
*
* DESCRIPTION:
*
- * XXX
+ * This routine looks up the specified name for a message queue and returns the
+ * id of the message queue associated with it.
*/
int _POSIX_Message_queue_Name_to_id(
diff --git a/c/src/exec/posix/inline/rtems/posix/mqueue.inl b/c/src/exec/posix/inline/rtems/posix/mqueue.inl
index 4feaed5b59..d37431038b 100644
--- a/c/src/exec/posix/inline/rtems/posix/mqueue.inl
+++ b/c/src/exec/posix/inline/rtems/posix/mqueue.inl
@@ -21,7 +21,8 @@
* _POSIX_Message_queue_Allocate
*/
-RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
+RTEMS_INLINE_ROUTINE
+ POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void )
{
return (POSIX_Message_queue_Control *)
_Objects_Allocate( &_POSIX_Message_queue_Information );
@@ -29,6 +30,18 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate(
/*PAGE
*
+ * _POSIX_Message_queue_Allocate_fd
+ */
+
+RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *
+ _POSIX_Message_queue_Allocate_fd( void )
+{
+ return (POSIX_Message_queue_Control_fd *)
+ _Objects_Allocate( &_POSIX_Message_queue_Information_fds );
+}
+
+/*PAGE
+ *
* _POSIX_Message_queue_Free
*/
@@ -41,6 +54,18 @@ RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
/*PAGE
*
+ * _POSIX_Message_queue_Free_fd
+ */
+
+RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd (
+ POSIX_Message_queue_Control_fd *the_mq_fd
+)
+{
+ _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object );
+}
+
+/*PAGE
+ *
* _POSIX_Message_queue_Namespace_remove
*/
@@ -68,6 +93,20 @@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
/*PAGE
*
+ * _POSIX_Message_queue_Get_fd
+ */
+
+RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd (
+ Objects_Id id,
+ Objects_Locations *location
+)
+{
+ return (POSIX_Message_queue_Control_fd *)
+ _Objects_Get( &_POSIX_Message_queue_Information_fds, id, location );
+}
+
+/*PAGE
+ *
* _POSIX_Message_queue_Is_null
*/
diff --git a/c/src/exec/posix/src/mqueue.c b/c/src/exec/posix/src/mqueue.c
index 5fda3bf2cd..5d3c39bd72 100644
--- a/c/src/exec/posix/src/mqueue.c
+++ b/c/src/exec/posix/src/mqueue.c
@@ -58,4 +58,14 @@ void _POSIX_Message_queue_Manager_initialization(
_POSIX_PATH_MAX,
FALSE
);
+ _Objects_Initialize_information(
+ &_POSIX_Message_queue_Information_fds,
+ OBJECTS_POSIX_MESSAGE_QUEUE_FDS,
+ FALSE,
+ maximum_message_queues,
+ sizeof( POSIX_Message_queue_Control_fd ),
+ FALSE,
+ 0,
+ FALSE
+ );
}
diff --git a/c/src/exec/posix/src/mqueueclose.c b/c/src/exec/posix/src/mqueueclose.c
index 80da647116..e809eac3ec 100644
--- a/c/src/exec/posix/src/mqueueclose.c
+++ b/c/src/exec/posix/src/mqueueclose.c
@@ -41,10 +41,11 @@ int mq_close(
mqd_t mqdes
)
{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
+ POSIX_Message_queue_Control *the_mq;
+ POSIX_Message_queue_Control_fd *the_mq_fd;
+ Objects_Locations location;
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
+ the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_ERROR:
rtems_set_errno_and_return_minus_one( EBADF );
@@ -53,8 +54,24 @@ int mq_close(
return POSIX_MP_NOT_IMPLEMENTED();
rtems_set_errno_and_return_minus_one( EINVAL );
case OBJECTS_LOCAL:
+ /*
+ * First update the actual message queue to reflect this descriptor
+ * being disassociated. This may result in the queue being really
+ * deleted.
+ */
+
+ the_mq = the_mq_fd->Queue;
the_mq->open_count -= 1;
_POSIX_Message_queue_Delete( the_mq );
+
+ /*
+ * Now close this file descriptor.
+ */
+
+ _Objects_Close(
+ &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object );
+ _POSIX_Message_queue_Free_fd( the_mq_fd );
+
_Thread_Enable_dispatch();
return 0;
}
diff --git a/c/src/exec/posix/src/mqueuecreatesupp.c b/c/src/exec/posix/src/mqueuecreatesupp.c
index ce9a4bcb29..35b3e1b826 100644
--- a/c/src/exec/posix/src/mqueuecreatesupp.c
+++ b/c/src/exec/posix/src/mqueuecreatesupp.c
@@ -41,9 +41,8 @@
*/
int _POSIX_Message_queue_Create_support(
- const char *name,
+ const char *_name,
int pshared,
- unsigned int oflag,
struct mq_attr *attr_ptr,
POSIX_Message_queue_Control **message_queue
)
@@ -51,6 +50,7 @@ int _POSIX_Message_queue_Create_support(
POSIX_Message_queue_Control *the_mq;
CORE_message_queue_Attributes *the_mq_attr;
struct mq_attr attr;
+ char *name;
_Thread_Disable_dispatch();
@@ -95,7 +95,6 @@ int _POSIX_Message_queue_Create_support(
}
the_mq->process_shared = pshared;
- the_mq->oflag = oflag;
the_mq->named = TRUE;
the_mq->open_count = 1;
the_mq->linked = TRUE;
@@ -133,6 +132,8 @@ int _POSIX_Message_queue_Create_support(
rtems_set_errno_and_return_minus_one( ENOSPC );
}
+ name = malloc(256);
+ strcpy( name, _name );
_Objects_Open(
&_POSIX_Message_queue_Information,
&the_mq->Object,
diff --git a/c/src/exec/posix/src/mqueuegetattr.c b/c/src/exec/posix/src/mqueuegetattr.c
index 3152611300..80be6335c7 100644
--- a/c/src/exec/posix/src/mqueuegetattr.c
+++ b/c/src/exec/posix/src/mqueuegetattr.c
@@ -42,14 +42,15 @@ int mq_getattr(
struct mq_attr *mqstat
)
{
- register POSIX_Message_queue_Control *the_mq;
+ POSIX_Message_queue_Control *the_mq;
+ POSIX_Message_queue_Control_fd *the_mq_fd;
Objects_Locations location;
CORE_message_queue_Attributes *the_mq_attr;
if ( !mqstat )
rtems_set_errno_and_return_minus_one( EINVAL );
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
+ the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_ERROR:
rtems_set_errno_and_return_minus_one( EBADF );
@@ -58,16 +59,15 @@ int mq_getattr(
return POSIX_MP_NOT_IMPLEMENTED();
rtems_set_errno_and_return_minus_one( EINVAL );
case OBJECTS_LOCAL:
+ the_mq = the_mq_fd->Queue;
+
/*
* Return the old values.
*/
- /* XXX this is the same stuff as is in mq_setattr... and probably */
- /* XXX should be in an inlined private routine */
-
the_mq_attr = &the_mq->Message_queue.Attributes;
- mqstat->mq_flags = the_mq->oflag;
+ mqstat->mq_flags = the_mq_fd->oflag;
mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size;
mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages;
mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages;
diff --git a/c/src/exec/posix/src/mqueuenotify.c b/c/src/exec/posix/src/mqueuenotify.c
index 35a1e1deca..93e24ac71f 100644
--- a/c/src/exec/posix/src/mqueuenotify.c
+++ b/c/src/exec/posix/src/mqueuenotify.c
@@ -64,10 +64,11 @@ int mq_notify(
const struct sigevent *notification
)
{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
+ POSIX_Message_queue_Control *the_mq;
+ POSIX_Message_queue_Control_fd *the_mq_fd;
+ Objects_Locations location;
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
+ the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_ERROR:
rtems_set_errno_and_return_minus_one( EBADF );
@@ -76,6 +77,8 @@ int mq_notify(
return POSIX_MP_NOT_IMPLEMENTED();
rtems_set_errno_and_return_minus_one( EINVAL );
case OBJECTS_LOCAL:
+ the_mq = the_mq_fd->Queue;
+
if ( notification ) {
if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) {
_Thread_Enable_dispatch();
diff --git a/c/src/exec/posix/src/mqueueopen.c b/c/src/exec/posix/src/mqueueopen.c
index 0cad4974f6..f0dfc34f7c 100644
--- a/c/src/exec/posix/src/mqueueopen.c
+++ b/c/src/exec/posix/src/mqueueopen.c
@@ -45,13 +45,14 @@ mqd_t mq_open(
/* struct mq_attr attr */
)
{
- va_list arg;
- mode_t mode;
- struct mq_attr *attr = NULL;
- int status;
- Objects_Id the_mq_id;
- POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
+ va_list arg;
+ mode_t mode;
+ struct mq_attr *attr = NULL;
+ int status;
+ Objects_Id the_mq_id;
+ POSIX_Message_queue_Control *the_mq;
+ POSIX_Message_queue_Control_fd *the_mq_fd;
+ Objects_Locations location;
_Thread_Disable_dispatch();
@@ -62,8 +63,15 @@ mqd_t mq_open(
va_end(arg);
}
+ the_mq_fd = _POSIX_Message_queue_Allocate_fd();
+ if ( !the_mq_fd ) {
+ _Thread_Enable_dispatch();
+ rtems_set_errno_and_return_minus_one( ENFILE );
+ }
+ the_mq_fd->oflag = oflag;
+
status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
-
+
/*
* If the name to id translation worked, then the message queue exists
* and we can just return a pointer to the id. Otherwise we may
@@ -79,6 +87,7 @@ mqd_t mq_open(
*/
if ( !( status == ENOENT && (oflag & O_CREAT) ) ) {
+ _POSIX_Message_queue_Free_fd( the_mq_fd );
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( status, mqd_t );
}
@@ -90,20 +99,22 @@ mqd_t mq_open(
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
+ _POSIX_Message_queue_Free_fd( the_mq_fd );
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t );
}
/*
- * XXX In this case we need to do an ID->pointer conversion to
- * check the mode. This is probably a good place for a subroutine.
+ * In this case we need to do an ID->pointer conversion to
+ * check the mode.
*/
the_mq = _POSIX_Message_queue_Get( the_mq_id, &location );
the_mq->open_count += 1;
+ the_mq_fd->Queue = the_mq;
_Thread_Enable_dispatch();
_Thread_Enable_dispatch();
- return (mqd_t)the_mq->Object.id;
+ return (mqd_t)the_mq_fd->Object.id;
}
@@ -115,7 +126,6 @@ mqd_t mq_open(
status = _POSIX_Message_queue_Create_support(
name,
TRUE, /* shared across processes */
- oflag,
attr,
&the_mq
);
@@ -124,12 +134,22 @@ mqd_t mq_open(
* errno was set by Create_support, so don't set it again.
*/
- _Thread_Enable_dispatch();
-
- if ( status == -1 )
+ if ( status == -1 ) {
+ _Thread_Enable_dispatch();
+ _POSIX_Message_queue_Free_fd( the_mq_fd );
return (mqd_t) -1;
+ }
+
+ the_mq_fd->Queue = the_mq;
+ _Objects_Open(
+ &_POSIX_Message_queue_Information_fds,
+ &the_mq_fd->Object,
+ NULL
+ );
- return (mqd_t) the_mq->Object.id;
+ _Thread_Enable_dispatch();
+
+ return (mqd_t) the_mq_fd->Object.id;
}
diff --git a/c/src/exec/posix/src/mqueuerecvsupp.c b/c/src/exec/posix/src/mqueuerecvsupp.c
index 8c12a2ef53..11d8fbc50c 100644
--- a/c/src/exec/posix/src/mqueuerecvsupp.c
+++ b/c/src/exec/posix/src/mqueuerecvsupp.c
@@ -48,11 +48,12 @@ ssize_t _POSIX_Message_queue_Receive_support(
Watchdog_Interval timeout
)
{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- unsigned32 length_out;
+ POSIX_Message_queue_Control *the_mq;
+ POSIX_Message_queue_Control_fd *the_mq_fd;
+ Objects_Locations location;
+ unsigned32 length_out;
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
+ the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_ERROR:
rtems_set_errno_and_return_minus_one( EBADF );
@@ -61,11 +62,13 @@ ssize_t _POSIX_Message_queue_Receive_support(
return POSIX_MP_NOT_IMPLEMENTED();
rtems_set_errno_and_return_minus_one( EINVAL );
case OBJECTS_LOCAL:
- if ( (the_mq->oflag & O_ACCMODE) == O_WRONLY ) {
+ if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EBADF );
}
+ the_mq = the_mq_fd->Queue;
+
if ( msg_len < the_mq->Message_queue.maximum_message_size ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EMSGSIZE );
@@ -83,7 +86,7 @@ ssize_t _POSIX_Message_queue_Receive_support(
mqdes,
msg_ptr,
&length_out,
- (the_mq->oflag & O_NONBLOCK) ? FALSE : TRUE,
+ (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE,
timeout
);
diff --git a/c/src/exec/posix/src/mqueuesendsupp.c b/c/src/exec/posix/src/mqueuesendsupp.c
index c7e6c50764..b3f249638c 100644
--- a/c/src/exec/posix/src/mqueuesendsupp.c
+++ b/c/src/exec/posix/src/mqueuesendsupp.c
@@ -46,9 +46,10 @@ int _POSIX_Message_queue_Send_support(
Watchdog_Interval timeout
)
{
- register POSIX_Message_queue_Control *the_mq;
- Objects_Locations location;
- CORE_message_queue_Status msg_status;
+ POSIX_Message_queue_Control *the_mq;
+ POSIX_Message_queue_Control_fd *the_mq_fd;
+ Objects_Locations location;
+ CORE_message_queue_Status msg_status;
/*
* Validate the priority.
@@ -58,8 +59,7 @@ int _POSIX_Message_queue_Send_support(
if ( msg_prio > MQ_PRIO_MAX )
rtems_set_errno_and_return_minus_one( EINVAL );
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
-
+ the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_ERROR:
rtems_set_errno_and_return_minus_one( EBADF );
@@ -70,11 +70,13 @@ int _POSIX_Message_queue_Send_support(
rtems_set_errno_and_return_minus_one( EINVAL );
case OBJECTS_LOCAL:
- if ( (the_mq->oflag & O_ACCMODE) == O_RDONLY ) {
+ if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EBADF );
}
+ the_mq = the_mq_fd->Queue;
+
msg_status = _CORE_message_queue_Submit(
&the_mq->Message_queue,
(void *) msg_ptr,
@@ -86,7 +88,7 @@ int _POSIX_Message_queue_Send_support(
NULL,
#endif
_POSIX_Message_queue_Priority_to_core( msg_prio ),
- (the_mq->oflag & O_NONBLOCK) ? FALSE : TRUE,
+ (the_mq_fd->oflag & O_NONBLOCK) ? FALSE : TRUE,
timeout /* no timeout */
);
diff --git a/c/src/exec/posix/src/mqueuesetattr.c b/c/src/exec/posix/src/mqueuesetattr.c
index 142b7ad15e..623bf32744 100644
--- a/c/src/exec/posix/src/mqueuesetattr.c
+++ b/c/src/exec/posix/src/mqueuesetattr.c
@@ -43,15 +43,14 @@ int mq_setattr(
struct mq_attr *omqstat
)
{
- register POSIX_Message_queue_Control *the_mq;
- CORE_message_queue_Control *the_core_mq;
- Objects_Locations location;
- CORE_message_queue_Attributes *the_mq_attr;
+ POSIX_Message_queue_Control_fd *the_mq_fd;
+ CORE_message_queue_Control *the_core_mq;
+ Objects_Locations location;
if ( !mqstat )
rtems_set_errno_and_return_minus_one( EINVAL );
- the_mq = _POSIX_Message_queue_Get( mqdes, &location );
+ the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location );
switch ( location ) {
case OBJECTS_ERROR:
rtems_set_errno_and_return_minus_one( EBADF );
@@ -61,38 +60,20 @@ int mq_setattr(
rtems_set_errno_and_return_minus_one( EINVAL );
case OBJECTS_LOCAL:
- the_core_mq = &the_mq->Message_queue;
+ the_core_mq = &the_mq_fd->Queue->Message_queue;
/*
* Return the old values.
*/
- /* XXX this is the same stuff as is in mq_getattr... and probably */
- /* XXX should be in an inlined private routine */
-
if ( omqstat ) {
- omqstat->mq_flags = the_mq->oflag;
+ omqstat->mq_flags = the_mq_fd->oflag;
omqstat->mq_msgsize = the_core_mq->maximum_message_size;
omqstat->mq_maxmsg = the_core_mq->maximum_pending_messages;
omqstat->mq_curmsgs = the_core_mq->number_of_pending_messages;
}
-
- /*
- * If blocking was in effect and is not now, then there
- * may be threads blocked on this message queue which need
- * to be unblocked to make the state of the message queue
- * consistent for future use.
- */
- the_mq_attr = &the_core_mq->Attributes;
-
- if ( !(the_mq->oflag & O_NONBLOCK) && /* were blocking */
- (mqstat->mq_flags & O_NONBLOCK) ) { /* and now are not */
- _CORE_message_queue_Flush_waiting_threads( the_core_mq );
- }
-
- the_mq->oflag = mqstat->mq_flags;
-
+ the_mq_fd->oflag = mqstat->mq_flags;
_Thread_Enable_dispatch();
return 0;
}