From 982e97463f66b09b79825c481f3b3f343ef361b8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 19 Jul 2013 15:00:11 +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/corerwlockobtainread.c | 2 +- cpukit/score/src/corerwlockobtainwrite.c | 2 +- cpukit/score/src/corerwlockrelease.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'cpukit/score/src') diff --git a/cpukit/score/src/corerwlockobtainread.c b/cpukit/score/src/corerwlockobtainread.c index 8c13f53465..2447360636 100644 --- a/cpukit/score/src/corerwlockobtainread.c +++ b/cpukit/score/src/corerwlockobtainread.c @@ -26,6 +26,7 @@ void _CORE_RWLock_Obtain_for_reading( CORE_RWLock_Control *the_rwlock, + Thread_Control *executing, Objects_Id id, bool wait, Watchdog_Interval timeout, @@ -33,7 +34,6 @@ void _CORE_RWLock_Obtain_for_reading( ) { ISR_Level level; - Thread_Control *executing = _Thread_Executing; /* * If unlocked, then OK to read. diff --git a/cpukit/score/src/corerwlockobtainwrite.c b/cpukit/score/src/corerwlockobtainwrite.c index 8335791545..1eca63c7ed 100644 --- a/cpukit/score/src/corerwlockobtainwrite.c +++ b/cpukit/score/src/corerwlockobtainwrite.c @@ -26,6 +26,7 @@ void _CORE_RWLock_Obtain_for_writing( CORE_RWLock_Control *the_rwlock, + Thread_Control *executing, Objects_Id id, bool wait, Watchdog_Interval timeout, @@ -33,7 +34,6 @@ void _CORE_RWLock_Obtain_for_writing( ) { ISR_Level level; - Thread_Control *executing = _Thread_Executing; /* * If unlocked, then OK to read. diff --git a/cpukit/score/src/corerwlockrelease.c b/cpukit/score/src/corerwlockrelease.c index 2bbf1a7238..c0b23e08e3 100644 --- a/cpukit/score/src/corerwlockrelease.c +++ b/cpukit/score/src/corerwlockrelease.c @@ -26,11 +26,11 @@ #include CORE_RWLock_Status _CORE_RWLock_Release( - CORE_RWLock_Control *the_rwlock + CORE_RWLock_Control *the_rwlock, + Thread_Control *executing ) { ISR_Level level; - Thread_Control *executing = _Thread_Executing; Thread_Control *next; /* -- cgit v1.2.3