diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-07-09 13:22:28 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-07-15 13:42:30 -0500 |
commit | 0ea6d07a030916ff1034e0152c7b56e652ee94f3 (patch) | |
tree | 42d69f4d62cd8cac3d6582492dfb618dac70e436 /cpukit/score/src/threadqdequeue.c | |
parent | Thread Queue: Merge discipline subroutines into main methods (diff) | |
download | rtems-0ea6d07a030916ff1034e0152c7b56e652ee94f3.tar.bz2 |
Use Shared Method for Thread Unblock Cleanup
When a thread is removed from a thread queue or is unblocked
by receiving an event, the same actions are required.
+ timeout watchdog canceled,
+ thread must be unblocked, and
+ (MP only) proxy cleaned up
This patch makes sure there is only one copy of this code.
Diffstat (limited to 'cpukit/score/src/threadqdequeue.c')
-rw-r--r-- | cpukit/score/src/threadqdequeue.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/cpukit/score/src/threadqdequeue.c b/cpukit/score/src/threadqdequeue.c index 3b55e52e83..d745ef29e3 100644 --- a/cpukit/score/src/threadqdequeue.c +++ b/cpukit/score/src/threadqdequeue.c @@ -70,22 +70,10 @@ Thread_Control *_Thread_queue_Dequeue( /* * We found a thread to unblock. + * + * NOTE: This is invoked with interrupts still disabled. */ - the_thread->Wait.queue = NULL; - if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { - _ISR_Enable( level ); - } else { - _Watchdog_Deactivate( &the_thread->Timer ); - _ISR_Enable( level ); - (void) _Watchdog_Remove( &the_thread->Timer ); - } - - _Thread_Unblock( the_thread ); - -#if defined(RTEMS_MULTIPROCESSING) - if ( !_Objects_Is_local_id( the_thread->Object.id ) ) - _Thread_MP_Free_proxy( the_thread ); -#endif + _Thread_blocking_operation_Finalize( the_thread, level ); return the_thread; } |