diff options
Diffstat (limited to 'cpukit/score/src/semaphore.c')
-rw-r--r-- | cpukit/score/src/semaphore.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/cpukit/score/src/semaphore.c b/cpukit/score/src/semaphore.c index db3c3a91eb..7743939973 100644 --- a/cpukit/score/src/semaphore.c +++ b/cpukit/score/src/semaphore.c @@ -159,18 +159,12 @@ void _Semaphore_Post( struct _Semaphore_Control *_sem ) ++sem->count; _Sem_Queue_release( sem, level, &queue_context ); } else { - const Thread_queue_Operations *operations; - Thread_Control *first; - _Thread_queue_Context_set_ISR_level( &queue_context, level ); - operations = SEMAPHORE_TQ_OPERATIONS; - first = ( *operations->first )( heads ); - - _Thread_queue_Extract_critical( + _Thread_queue_Surrender_no_priority( &sem->Queue.Queue, - operations, - first, - &queue_context + heads, + &queue_context, + SEMAPHORE_TQ_OPERATIONS ); } } @@ -192,18 +186,12 @@ void _Semaphore_Post_binary( struct _Semaphore_Control *_sem ) sem->count = 1; _Sem_Queue_release( sem, level, &queue_context ); } else { - const Thread_queue_Operations *operations; - Thread_Control *first; - _Thread_queue_Context_set_ISR_level( &queue_context, level ); - operations = SEMAPHORE_TQ_OPERATIONS; - first = ( *operations->first )( heads ); - - _Thread_queue_Extract_critical( + _Thread_queue_Surrender_no_priority( &sem->Queue.Queue, - operations, - first, - &queue_context + heads, + &queue_context, + SEMAPHORE_TQ_OPERATIONS ); } } |