diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-19 16:20:49 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 16:57:22 +0200 |
commit | 4cb8e597a791d3147585fb37160a8dc215d7db83 (patch) | |
tree | 882ea7e9bdb3fc37f0c5d2cd24c232ddb5f68c67 | |
parent | posix: Create condition variable impl header (diff) | |
download | rtems-4cb8e597a791d3147585fb37160a8dc215d7db83.tar.bz2 |
score: Obtain _Thread_Executing in proper context
-rw-r--r-- | cpukit/posix/src/condwaitsupp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c index 690431aa43..0da3a67dbb 100644 --- a/cpukit/posix/src/condwaitsupp.c +++ b/cpukit/posix/src/condwaitsupp.c @@ -41,6 +41,7 @@ int _POSIX_Condition_variables_Wait_support( Objects_Locations location; int status; int mutex_status; + Thread_Control *executing; the_mutex = _POSIX_Mutex_Get( mutex, &location ); if ( !the_mutex ) { @@ -71,9 +72,10 @@ int _POSIX_Condition_variables_Wait_support( the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); - _Thread_Executing->Wait.return_code = 0; - _Thread_Executing->Wait.queue = &the_cond->Wait_queue; - _Thread_Executing->Wait.id = *cond; + executing = _Thread_Executing; + executing->Wait.return_code = 0; + executing->Wait.queue = &the_cond->Wait_queue; + executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); @@ -91,7 +93,7 @@ int _POSIX_Condition_variables_Wait_support( * returns a success status, except for the fact that it was not * woken up a pthread_cond_signal or a pthread_cond_broadcast. */ - status = _Thread_Executing->Wait.return_code; + status = executing->Wait.return_code; if ( status == EINTR ) status = 0; |