diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-23 11:40:18 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-25 12:43:54 +0200 |
commit | 631b3c8967a329cdd53e54365e4e4c0aa93a4251 (patch) | |
tree | 3a750b145a90c90aa86222c26ee68aeb8c87a417 /cpukit/posix/src/condwaitsupp.c | |
parent | score: Get rid of mp_id parameter (diff) | |
download | rtems-631b3c8967a329cdd53e54365e4e4c0aa93a4251.tar.bz2 |
score: Move thread queue MP callout to context
Drop the multiprocessing (MP) dependent callout parameter from the
thread queue extract, dequeue, flush and unblock methods. Merge this
parameter with the lock context into new structure Thread_queue_Context.
This helps to gets rid of the conditionally compiled method call
helpers.
Diffstat (limited to 'cpukit/posix/src/condwaitsupp.c')
-rw-r--r-- | cpukit/posix/src/condwaitsupp.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c index 11b05872f3..4e89ef0b50 100644 --- a/cpukit/posix/src/condwaitsupp.c +++ b/cpukit/posix/src/condwaitsupp.c @@ -35,7 +35,7 @@ int _POSIX_Condition_variables_Wait_support( { POSIX_Condition_variables_Control *the_cond; POSIX_Mutex_Control *the_mutex; - ISR_lock_Context lock_context; + Thread_queue_Context queue_context; int status; int mutex_status; CORE_mutex_Status core_mutex_status; @@ -46,25 +46,25 @@ int _POSIX_Condition_variables_Wait_support( return EINVAL; } - the_cond = _POSIX_Condition_variables_Get( cond, &lock_context ); + the_cond = _POSIX_Condition_variables_Get( cond, &queue_context ); if ( the_cond == NULL ) { return EINVAL; } - _POSIX_Condition_variables_Acquire_critical( the_cond, &lock_context ); + _POSIX_Condition_variables_Acquire_critical( the_cond, &queue_context ); if ( the_cond->mutex != POSIX_CONDITION_VARIABLES_NO_MUTEX && the_cond->mutex != *mutex ) { - _POSIX_Condition_variables_Release( the_cond, &lock_context ); + _POSIX_Condition_variables_Release( the_cond, &queue_context ); return EINVAL; } the_cond->mutex = *mutex; - cpu_self = _Thread_Dispatch_disable_critical( &lock_context ); + cpu_self = _Thread_Dispatch_disable_critical( &queue_context.Lock_context ); executing = _Per_CPU_Get_executing( cpu_self ); /* @@ -78,7 +78,7 @@ int _POSIX_Condition_variables_Wait_support( the_mutex == NULL || !_CORE_mutex_Is_owner( &the_mutex->Mutex, executing ) ) { - _POSIX_Condition_variables_Release( the_cond, &lock_context ); + _POSIX_Condition_variables_Release( the_cond, &queue_context ); _Thread_Dispatch_enable( cpu_self ); return EPERM; } @@ -92,18 +92,17 @@ int _POSIX_Condition_variables_Wait_support( STATES_WAITING_FOR_CONDITION_VARIABLE, timeout, ETIMEDOUT, - &lock_context + &queue_context.Lock_context ); } else { - _POSIX_Condition_variables_Release( the_cond, &lock_context ); + _POSIX_Condition_variables_Release( the_cond, &queue_context ); executing->Wait.return_code = ETIMEDOUT; } - _ISR_lock_ISR_disable( &lock_context ); + _ISR_lock_ISR_disable( &queue_context.Lock_context ); core_mutex_status = _CORE_mutex_Surrender( &the_mutex->Mutex, - NULL, - &lock_context + &queue_context ); _Assert( core_mutex_status == CORE_MUTEX_STATUS_SUCCESSFUL ); (void) core_mutex_status; |