[rtems commit] score: Avoid direct usage of _Thread_Executing

Sebastian Huber sebh at rtems.org
Mon Jul 22 14:51:44 UTC 2013


Module:    rtems
Branch:    master
Commit:    16243a207b2ae5ffa13b4cbd361c9f2c80d5e199
Changeset: http://git.rtems.org/rtems/commit/?id=16243a207b2ae5ffa13b4cbd361c9f2c80d5e199

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jul 19 15:32:51 2013 +0200

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 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/score/include/rtems/score/coremuteximpl.h b/cpukit/score/include/rtems/score/coremuteximpl.h
index 67e7c99..e84875d 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 );




More information about the vc mailing list