From 173d1f84736c50cdfbd058b2570d698957b7ba94 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 14 Dec 2015 13:10:24 +0100 Subject: posix: Store unblocked signals Store the unblock signals to exploit the zero-initialization of the thread control block. --- cpukit/posix/src/pthreadsigmask.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpukit/posix/src/pthreadsigmask.c') 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(); } -- cgit v1.2.3