diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-14 13:10:24 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-12-15 07:41:34 +0100 |
commit | 173d1f84736c50cdfbd058b2570d698957b7ba94 (patch) | |
tree | c92e5aceb83cb3e041039e9a4d47b1bd4c97249a /cpukit/posix/src/pthreadsigmask.c | |
parent | score: Initialize thread control to zero (diff) | |
download | rtems-173d1f84736c50cdfbd058b2570d698957b7ba94.tar.bz2 |
posix: Store unblocked signals
Store the unblock signals to exploit the zero-initialization of the
thread control block.
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/pthreadsigmask.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cpukit/posix/src/pthreadsigmask.c b/cpukit/posix/src/pthreadsigmask.c index 7c2d99c3ef..908ffd010f 100644 --- a/cpukit/posix/src/pthreadsigmask.c +++ b/cpukit/posix/src/pthreadsigmask.c @@ -45,20 +45,20 @@ int pthread_sigmask( api = _Thread_Get_executing()->API_Extensions[ THREAD_API_POSIX ]; if ( oset ) - *oset = api->signals_blocked; + *oset = ~api->signals_unblocked; if ( !set ) return 0; switch ( how ) { case SIG_BLOCK: - api->signals_blocked |= *set; + api->signals_unblocked &= ~*set; break; case SIG_UNBLOCK: - api->signals_blocked &= ~*set; + api->signals_unblocked |= *set; break; case SIG_SETMASK: - api->signals_blocked = *set; + api->signals_unblocked = ~*set; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); @@ -68,7 +68,7 @@ int pthread_sigmask( /* XXX evaluate the new set */ - if ( ~api->signals_blocked & + if ( api->signals_unblocked & (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Dispatch(); } |