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/threadqextract.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 '')
-rw-r--r-- | cpukit/score/src/threadqextract.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/cpukit/score/src/threadqextract.c b/cpukit/score/src/threadqextract.c index bc7d34686a..d12d3c889a 100644 --- a/cpukit/score/src/threadqextract.c +++ b/cpukit/score/src/threadqextract.c @@ -48,24 +48,14 @@ void _Thread_queue_Extract_with_return_code( ); } - the_thread->Wait.queue = NULL; the_thread->Wait.return_code = return_code; - 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 - + /* + * We found a thread to unblock. + * + * NOTE: This is invoked with interrupts still disabled. + */ + _Thread_blocking_operation_Finalize( the_thread, level ); } void _Thread_queue_Extract( |