diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-03-10 08:01:23 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-03-10 08:01:23 +0000 |
commit | 45ada7f2f2150ea7c3cdd34784456a97be3e150f (patch) | |
tree | 4a88fd78d5a202dcc26bae509e255a019c41e9a9 /lib/librt/sigev_thread.c | |
parent | 90b66ded94e28409fde4c951fb14f791b84596dc (diff) | |
download | FreeBSD-src-45ada7f2f2150ea7c3cdd34784456a97be3e150f.zip FreeBSD-src-45ada7f2f2150ea7c3cdd34784456a97be3e150f.tar.gz |
Block all signals in helper threads except those should not be blocked.
Diffstat (limited to 'lib/librt/sigev_thread.c')
-rw-r--r-- | lib/librt/sigev_thread.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/librt/sigev_thread.c b/lib/librt/sigev_thread.c index 8f0f08e..2675171 100644 --- a/lib/librt/sigev_thread.c +++ b/lib/librt/sigev_thread.c @@ -305,7 +305,7 @@ static struct sigev_thread * sigev_thread_create(int usedefault) { struct sigev_thread *tn; - sigset_t set; + sigset_t set, oset; int ret; if (usedefault && sigev_default_thread) { @@ -326,13 +326,16 @@ sigev_thread_create(int usedefault) LIST_INSERT_HEAD(&sigev_threads, tn, tn_link); __sigev_list_unlock(); - sigemptyset(&set); - sigaddset(&set, SIGSERVICE); - - _sigprocmask(SIG_BLOCK, &set, NULL); + sigfillset(&set); /* SIGSERVICE is masked. */ + sigdelset(&set, SIGBUS); + sigdelset(&set, SIGILL); + sigdelset(&set, SIGFPE); + sigdelset(&set, SIGSEGV); + sigdelset(&set, SIGTRAP); + _sigprocmask(SIG_SETMASK, &set, &oset); ret = pthread_create(&tn->tn_thread, &sigev_default_attr, sigev_service_loop, tn); - _sigprocmask(SIG_UNBLOCK, &set, NULL); + _sigprocmask(SIG_SETMASK, &oset, NULL); if (ret != 0) { __sigev_list_lock(); |