diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-18 16:00:54 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 16:56:59 +0200 |
commit | 33a4a56e7f2c52148bfd09cdcb7371d9b1b37eb5 (patch) | |
tree | 63951d498925df25b7d2dbd93a95e1645c6fab2c /cpukit/posix/src/mqueuesendsupp.c | |
parent | score: Create message queue implementation header (diff) | |
download | rtems-33a4a56e7f2c52148bfd09cdcb7371d9b1b37eb5.tar.bz2 |
score: Avoid direct usage of _Thread_Executing
Pass the executing thread as a function parameter. Obtain the executing
thread inside a thread dispatch critical section to avoid problems on
SMP.
Diffstat (limited to 'cpukit/posix/src/mqueuesendsupp.c')
-rw-r--r-- | cpukit/posix/src/mqueuesendsupp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/posix/src/mqueuesendsupp.c b/cpukit/posix/src/mqueuesendsupp.c index 2b2acb86a8..7156763cf8 100644 --- a/cpukit/posix/src/mqueuesendsupp.c +++ b/cpukit/posix/src/mqueuesendsupp.c @@ -63,6 +63,7 @@ int _POSIX_Message_queue_Send_support( Objects_Locations location; CORE_message_queue_Status msg_status; bool do_wait; + Thread_Control *executing; /* * Validate the priority. @@ -94,8 +95,10 @@ int _POSIX_Message_queue_Send_support( /* * Now perform the actual message receive */ + executing = _Thread_Executing; msg_status = _CORE_message_queue_Submit( &the_mq->Message_queue, + executing, msg_ptr, msg_len, mqdes, /* mqd_t is an object id */ @@ -115,7 +118,7 @@ int _POSIX_Message_queue_Send_support( */ if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT ) - msg_status = _Thread_Executing->Wait.return_code; + msg_status = executing->Wait.return_code; if ( !msg_status ) return msg_status; |