From 16243a207b2ae5ffa13b4cbd361c9f2c80d5e199 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 19 Jul 2013 15:32:51 +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/include/rtems/score/coremuteximpl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cpukit/score') diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h index 67e7c99e7a..e84875d963 100644 --- a/cpukit/score/include/rtems/score/coremuteximpl.h +++ b/cpukit/score/include/rtems/score/coremuteximpl.h @@ -261,12 +261,12 @@ RTEMS_INLINE_ROUTINE void _CORE_mutex_Seize_body( if ( _CORE_mutex_Seize_interrupt_trylock( the_mutex, executing, level ) ) { if ( !wait ) { _ISR_Enable( level ); - _Thread_Executing->Wait.return_code = + executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT; } else { _Thread_queue_Enter_critical_section( &the_mutex->Wait_queue ); - _Thread_Executing->Wait.queue = &the_mutex->Wait_queue; - _Thread_Executing->Wait.id = id; + executing->Wait.queue = &the_mutex->Wait_queue; + executing->Wait.id = id; _Thread_Disable_dispatch(); _ISR_Enable( level ); _CORE_mutex_Seize_interrupt_blocking( the_mutex, executing, timeout ); -- cgit v1.2.3