summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-19 17:18:15 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-22 16:57:25 +0200
commit768c5cee1895f81823c6505e5b18d0eee5470fec (patch)
tree722c7ba56991f53c6d683de58a741e22644a71d0
parent16243a207b2ae5ffa13b4cbd361c9f2c80d5e199 (diff)
downloadrtems-768c5cee1895f81823c6505e5b18d0eee5470fec.tar.bz2
posix: Obtain _Thread_Executing in proper context
-rw-r--r--cpukit/posix/src/pthreadjoin.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cpukit/posix/src/pthreadjoin.c b/cpukit/posix/src/pthreadjoin.c
index 0ee700a528..9dc1b240e8 100644
--- a/cpukit/posix/src/pthreadjoin.c
+++ b/cpukit/posix/src/pthreadjoin.c
@@ -37,6 +37,7 @@ int pthread_join(
POSIX_API_Control *api;
Objects_Locations location;
void *return_pointer;
+ Thread_Control *executing;
on_EINTR:
the_thread = _Thread_Get( thread, &location );
@@ -50,7 +51,9 @@ on_EINTR:
return EINVAL;
}
- if ( _Thread_Is_executing( the_thread ) ) {
+ executing = _Thread_Executing;
+
+ if ( executing == the_thread ) {
_Objects_Put( &the_thread->Object );
return EDEADLK;
}
@@ -67,13 +70,13 @@ on_EINTR:
(STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_TRANSIENT)
);
} else {
- _Thread_Executing->Wait.return_argument = &return_pointer;
+ executing->Wait.return_argument = &return_pointer;
_Thread_queue_Enter_critical_section( &api->Join_List );
_Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT );
}
_Objects_Put( &the_thread->Object );
- if ( _Thread_Executing->Wait.return_code == EINTR )
+ if ( executing->Wait.return_code == EINTR )
goto on_EINTR;
if ( value_ptr )