diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-31 22:40:23 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-31 22:40:23 +0000 |
commit | f05af6b733bf4635be42570134132d664ca130b2 (patch) | |
tree | 0f88f2ba736d0e5913f317aca9c35d41c75c18a6 /cpukit/posix/src/psignal.c | |
parent | 2011-07-31 Joel Sherrill <joel.sherrilL@OARcorp.com> (diff) | |
download | rtems-f05af6b733bf4635be42570134132d664ca130b2.tar.bz2 |
2011-07-31 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1855/cpukit
* posix/src/psignal.c, posix/src/pthread.c, posix/src/pthreadjoin.c:
Correct signal processing during pthread_join. We are supposed to
unblock the thread waiting on a pthread_join(), dispatch the signal
handler, account for it potentially overwriting errno, and then have
the thread return to blocking within pthread_join().
Diffstat (limited to 'cpukit/posix/src/psignal.c')
-rw-r--r-- | cpukit/posix/src/psignal.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index d658274de8..e0e3e86a76 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -112,10 +112,17 @@ void _POSIX_signals_Post_switch_extension( POSIX_API_Control *api; int signo; ISR_Level level; + int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* + * We need to ensure that if the signal handler executes a call + * which overwrites the unblocking status, we restore it. + */ + hold_errno = _Thread_Executing->Wait.return_code; + + /* * api may be NULL in case of a thread close in progress */ if ( !api ) @@ -149,6 +156,8 @@ void _POSIX_signals_Post_switch_extension( _POSIX_signals_Check_signal( api, signo, true ); } } + + _Thread_Executing->Wait.return_code = hold_errno; } /* |