summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-18 14:27:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-22 16:56:58 +0200
commite36f2b8c914b73bacfc89b997f4a59d5387303ce (patch)
tree19f4c9e363b353ea441c2459e5b697d18c4c8c5e /cpukit/score/src
parentscore: Add const qualifier (diff)
downloadrtems-e36f2b8c914b73bacfc89b997f4a59d5387303ce.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/score/src')
-rw-r--r--cpukit/score/src/coresemseize.c3
-rw-r--r--cpukit/score/src/mpci.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/cpukit/score/src/coresemseize.c b/cpukit/score/src/coresemseize.c
index 7ad23171bf..8da9ca3044 100644
--- a/cpukit/score/src/coresemseize.c
+++ b/cpukit/score/src/coresemseize.c
@@ -30,15 +30,14 @@
void _CORE_semaphore_Seize(
CORE_semaphore_Control *the_semaphore,
+ Thread_Control *executing,
Objects_Id id,
bool wait,
Watchdog_Interval timeout
)
{
- Thread_Control *executing;
ISR_Level level;
- executing = _Thread_Executing;
executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL;
_ISR_Disable( level );
if ( the_semaphore->count != 0 ) {
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c
index e4c43b7219..9ba6106555 100644
--- a/cpukit/score/src/mpci.c
+++ b/cpukit/score/src/mpci.c
@@ -289,14 +289,20 @@ Thread _MPCI_Receive_server(
MPCI_Packet_processor the_function;
Thread_Control *executing;
- executing = _Thread_Executing;
+ executing = _Thread_Get_executing();
for ( ; ; ) {
executing->receive_packet = NULL;
_Thread_Disable_dispatch();
- _CORE_semaphore_Seize( &_MPCI_Semaphore, 0, true, WATCHDOG_NO_TIMEOUT );
+ _CORE_semaphore_Seize(
+ &_MPCI_Semaphore,
+ executing,
+ 0,
+ true,
+ WATCHDOG_NO_TIMEOUT
+ );
_Thread_Enable_dispatch();
for ( ; ; ) {