From 33a4a56e7f2c52148bfd09cdcb7371d9b1b37eb5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 18 Jul 2013 16:00:54 +0200 Subject: 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. --- cpukit/score/src/coremsgseize.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cpukit/score/src/coremsgseize.c') diff --git a/cpukit/score/src/coremsgseize.c b/cpukit/score/src/coremsgseize.c index f0567dbce4..5d64616ace 100644 --- a/cpukit/score/src/coremsgseize.c +++ b/cpukit/score/src/coremsgseize.c @@ -29,6 +29,7 @@ void _CORE_message_queue_Seize( CORE_message_queue_Control *the_message_queue, + Thread_Control *executing, Objects_Id id, void *buffer, size_t *size_p, @@ -38,9 +39,7 @@ void _CORE_message_queue_Seize( { ISR_Level level; CORE_message_queue_Buffer_control *the_message; - Thread_Control *executing; - executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); @@ -49,7 +48,7 @@ void _CORE_message_queue_Seize( _ISR_Enable( level ); *size_p = the_message->Contents.size; - _Thread_Executing->Wait.count = + executing->Wait.count = _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, -- cgit v1.2.3