diff options
author | deischen <deischen@FreeBSD.org> | 2003-04-18 05:04:16 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-04-18 05:04:16 +0000 |
commit | 5d56aa9cb2bdbe0a18bafbdbb6eb8cf6a46beb79 (patch) | |
tree | 46bc1e113ddc7c1ed88e4fa724039df8664c963a /lib/libpthread/thread/thr_sigaction.c | |
parent | e68f624d876da04bfb6860b450593c77d80368bd (diff) | |
download | FreeBSD-src-5d56aa9cb2bdbe0a18bafbdbb6eb8cf6a46beb79.zip FreeBSD-src-5d56aa9cb2bdbe0a18bafbdbb6eb8cf6a46beb79.tar.gz |
Revamp libpthread so that it has a chance of working in an SMP
environment. This includes support for multiple KSEs and KSEGs.
The ability to create more than 1 KSE via pthread_setconcurrency()
is in the works as well as support for PTHREAD_SCOPE_SYSTEM threads.
Those should come shortly.
There are still some known issues which davidxu and I are working
on, but it'll make it easier for us by committing what we have.
This library now passes all of the ACE tests that libc_r passes
with the exception of one. It also seems to work OK with KDE
including konqueror, kwrite, etc. I haven't been able to get
mozilla to run due to lack of java plugin, so I'd be interested
to see how it works with that.
Reviewed by: davidxu
Diffstat (limited to 'lib/libpthread/thread/thr_sigaction.c')
-rw-r--r-- | lib/libpthread/thread/thr_sigaction.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/libpthread/thread/thr_sigaction.c b/lib/libpthread/thread/thr_sigaction.c index a16f859..7ede6d2 100644 --- a/lib/libpthread/thread/thr_sigaction.c +++ b/lib/libpthread/thread/thr_sigaction.c @@ -50,8 +50,8 @@ _sigaction(int sig, const struct sigaction * act, struct sigaction * oact) errno = EINVAL; ret = -1; } else { - if (_thread_initial == NULL) - _thread_init(); + if (_thr_initial == NULL) + _libpthread_init(NULL); /* * Check if the existing signal action structure contents are @@ -76,14 +76,9 @@ _sigaction(int sig, const struct sigaction * act, struct sigaction * oact) * Check if the kernel needs to be advised of a change * in signal action: */ - if (act != NULL && sig != SIGCHLD) { - /* - * Ensure the signal handler cannot be interrupted - * by other signals. Always request the POSIX signal - * handler arguments. - */ - sigfillset(&gact.sa_mask); - gact.sa_flags = SA_SIGINFO | SA_ONSTACK; + if (act != NULL && sig != SIGINFO) { + gact.sa_mask = act->sa_mask; + gact.sa_flags = SA_SIGINFO | act->sa_flags; /* * Check if the signal handler is being set to @@ -98,10 +93,10 @@ _sigaction(int sig, const struct sigaction * act, struct sigaction * oact) * Specify the thread kernel signal * handler: */ - gact.sa_handler = (void (*) ()) _thread_sig_handler; + gact.sa_handler = (void (*) ())_thr_sig_handler; /* Change the signal action in the kernel: */ - if (__sys_sigaction(sig,&gact,NULL) != 0) + if (__sys_sigaction(sig, &gact, NULL) != 0) ret = -1; } } |