diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2001-01-24 13:03:38 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2001-01-24 13:03:38 +0000 |
| commit | e5106342c6de9cbe26c4827e4e29bae309cd8cfb (patch) | |
| tree | 5199387f09deaa21f12482317c165f815c4e8c2b /lib/libpthread/thread/thr_sigmask.c | |
| parent | f9447cd11209a5fb5ecef3f4cbe539e990f3b1bd (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_sigmask.c')
| -rw-r--r-- | lib/libpthread/thread/thr_sigmask.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/libpthread/thread/thr_sigmask.c b/lib/libpthread/thread/thr_sigmask.c index 53d0774f3b68..c16d66bd5415 100644 --- a/lib/libpthread/thread/thr_sigmask.c +++ b/lib/libpthread/thread/thr_sigmask.c @@ -36,20 +36,22 @@ #include <sys/signalvar.h> #include <errno.h> #include <signal.h> -#ifdef _THREAD_SAFE #include <pthread.h> #include "pthread_private.h" +#pragma weak pthread_sigmask=_pthread_sigmask + int -pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) +_pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) { + struct pthread *curthread = _get_curthread(); sigset_t sigset; int ret = 0; /* Check if the existing signal process mask is to be returned: */ if (oset != NULL) { /* Return the current mask: */ - *oset = _thread_run->sigmask; + *oset = curthread->sigmask; } /* Check if a new signal set was provided by the caller: */ if (set != NULL) { @@ -58,19 +60,19 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) /* Block signals: */ case SIG_BLOCK: /* Add signals to the existing mask: */ - SIGSETOR(_thread_run->sigmask, *set); + SIGSETOR(curthread->sigmask, *set); break; /* Unblock signals: */ case SIG_UNBLOCK: /* Clear signals from the existing mask: */ - SIGSETNAND(_thread_run->sigmask, *set); + SIGSETNAND(curthread->sigmask, *set); break; /* Set the signal process mask: */ case SIG_SETMASK: /* Set the new mask: */ - _thread_run->sigmask = *set; + curthread->sigmask = *set; break; /* Trap invalid actions: */ @@ -82,15 +84,15 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) } /* Increment the sequence number: */ - _thread_run->sigmask_seqno++; + curthread->sigmask_seqno++; /* * Check if there are pending signals for the running * thread or process that aren't blocked: */ - sigset = _thread_run->sigpend; + sigset = curthread->sigpend; SIGSETOR(sigset, _process_sigpending); - SIGSETNAND(sigset, _thread_run->sigmask); + SIGSETNAND(sigset, curthread->sigmask); if (SIGNOTEMPTY(sigset)) /* * Call the kernel scheduler which will safely @@ -102,4 +104,3 @@ pthread_sigmask(int how, const sigset_t *set, sigset_t *oset) /* Return the completion status: */ return (ret); } -#endif |
