From 030fee5b027110617286387f24b8993aa4976a09 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Wed, 19 Dec 2007 19:13:54 +0000 Subject: 2007-12-19 Jennifer Averett * posix/src/psignalunblockthread.c: Remove source that --- cpukit/posix/src/psignalunblockthread.c | 43 +++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'cpukit/posix/src/psignalunblockthread.c') diff --git a/cpukit/posix/src/psignalunblockthread.c b/cpukit/posix/src/psignalunblockthread.c index f3abc3d759..980413ff74 100644 --- a/cpukit/posix/src/psignalunblockthread.c +++ b/cpukit/posix/src/psignalunblockthread.c @@ -80,18 +80,47 @@ boolean _POSIX_signals_Unblock_thread( return FALSE; } + /* + * Thread is not waiting due to a sigwait. + */ if ( ~api->signals_blocked & mask ) { + + /* + * The thread is interested in this signal. We are going + * to post it. We have a few broad cases: + * + If it is blocked on an interruptible signal, THEN + * we unblock the thread. + * + If it is in the ready state AND + * we are sending from an ISR AND + * it is the interrupted thread AND + * it is not blocked, THEN + * we need to dispatch at the end of this ISR. + * + Any other combination, do nothing. + */ + the_thread->do_post_task_switch_extension = TRUE; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { the_thread->Wait.return_code = EINTR; - if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) - _Thread_queue_Extract_with_proxy( the_thread ); - else if ( _States_Is_delaying(the_thread->current_state)){ - if ( _Watchdog_Is_active( &the_thread->Timer ) ) - (void) _Watchdog_Remove( &the_thread->Timer ); - _Thread_Unblock( the_thread ); - } + /* + * At this time, there is no RTEMS API object which lets a task + * block on a thread queue and be interruptible by a POSIX signal. + * If an object class with that requirement is ever added, enable + * this code. + */ + #if 0 + if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) + _Thread_queue_Extract_with_proxy( the_thread ); + else + #endif + if ( _States_Is_delaying(the_thread->current_state) ){ + if ( _Watchdog_Is_active( &the_thread->Timer ) ) + (void) _Watchdog_Remove( &the_thread->Timer ); + _Thread_Unblock( the_thread ); + } + } else if ( the_thread->current_state == STATES_READY ) { + if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) + _ISR_Signals_to_thread_executing = TRUE; } } return FALSE; -- cgit v1.2.3