From 5d56aa9cb2bdbe0a18bafbdbb6eb8cf6a46beb79 Mon Sep 17 00:00:00 2001 From: deischen Date: Fri, 18 Apr 2003 05:04:16 +0000 Subject: 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 --- lib/libkse/thread/thr_sigaction.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'lib/libkse/thread/thr_sigaction.c') diff --git a/lib/libkse/thread/thr_sigaction.c b/lib/libkse/thread/thr_sigaction.c index a16f859..7ede6d2 100644 --- a/lib/libkse/thread/thr_sigaction.c +++ b/lib/libkse/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; } } -- cgit v1.1