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/rtems/src/msgqreceive.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/rtems/src/msgqreceive.c')
-rw-r--r-- | cpukit/rtems/src/msgqreceive.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/rtems/src/msgqreceive.c b/cpukit/rtems/src/msgqreceive.c index 265e71e243..484cb53331 100644 --- a/cpukit/rtems/src/msgqreceive.c +++ b/cpukit/rtems/src/msgqreceive.c @@ -47,6 +47,7 @@ rtems_status_code rtems_message_queue_receive( register Message_queue_Control *the_message_queue; Objects_Locations location; bool wait; + Thread_Control *executing; if ( !buffer ) return RTEMS_INVALID_ADDRESS; @@ -63,8 +64,10 @@ rtems_status_code rtems_message_queue_receive( else wait = true; + executing = _Thread_Executing; _CORE_message_queue_Seize( &the_message_queue->message_queue, + executing, the_message_queue->Object.id, buffer, size, @@ -73,7 +76,7 @@ rtems_status_code rtems_message_queue_receive( ); _Objects_Put( &the_message_queue->Object ); return _Message_queue_Translate_core_message_queue_return_code( - _Thread_Executing->Wait.return_code + executing->Wait.return_code ); #if defined(RTEMS_MULTIPROCESSING) |