From e6145fa515cb38d180f2cc99f75402a65426fff6 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 26 Oct 2005 16:30:00 +0000 Subject: [PATCH] (empth_start, empth_init) [_EMPTH_POSIX]: Do not handle SIGALRM. We don't raise it, and the signal handler is fishy. (empth_alarm): Unused, remove. --- include/empthread.h | 3 --- src/lib/empthread/lwp.c | 6 ------ src/lib/empthread/ntthread.c | 14 -------------- src/lib/empthread/pthread.c | 22 ---------------------- 4 files changed, 45 deletions(-) diff --git a/include/empthread.h b/include/empthread.h index e10df7f3..8fee0f55 100644 --- a/include/empthread.h +++ b/include/empthread.h @@ -205,7 +205,4 @@ void empth_sem_signal(empth_sem_t *sem); */ void empth_sem_wait(empth_sem_t *sem); -/* Internal function, not part of the thread abstraction */ -void empth_alarm(int); - #endif diff --git a/src/lib/empthread/lwp.c b/src/lib/empthread/lwp.c index 2805e636..c1aea95d 100644 --- a/src/lib/empthread/lwp.c +++ b/src/lib/empthread/lwp.c @@ -126,10 +126,4 @@ empth_sem_wait(empth_sem_t *sm) lwpWait(sm); } -void -empth_alarm(int sig) -{ - /* no way we can be here while using LWP threads */ - panic(sig); -} #endif diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index 752d2877..a88302ae 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -569,20 +569,6 @@ empth_select(int fd, int flags) loc_RunThisThread(); } -/************************ - * empth_alarm - */ -void -empth_alarm(int sig) -{ - empth_t *pThread = TlsGetValue(dwTLSIndex); - - loc_debug("got alarm signal %d", sig); - - /* Let it run if it is blocked like... */ - SetEvent(pThread->hThreadEvent); -} - /************************ * empth_wakeup * diff --git a/src/lib/empthread/pthread.c b/src/lib/empthread/pthread.c index 7be23417..408bfb77 100644 --- a/src/lib/empthread/pthread.c +++ b/src/lib/empthread/pthread.c @@ -109,9 +109,6 @@ empth_start(void *arg) act.sa_handler = SIG_IGN; sigaction(SIGPIPE, &act, NULL); - act.sa_handler = empth_alarm; - sigaction(SIGALRM, &act, NULL); - ctx->id = pthread_self(); pthread_setspecific(ctx_key, ctx); pthread_mutex_lock(&mtx_ctxsw); @@ -156,17 +153,11 @@ int empth_init(void **ctx_ptr, int flags) { empth_t *ctx; - struct sigaction act; pthread_key_create(&ctx_key, NULL); pthread_mutex_init(&mtx_ctxsw, NULL); - act.sa_flags = 0; - sigemptyset(&act.sa_mask); - act.sa_handler = empth_alarm; - sigaction(SIGALRM, &act, NULL); - udata = ctx_ptr; ctx = malloc(sizeof(empth_t)); if (!ctx) { @@ -362,19 +353,6 @@ empth_select(int fd, int flags) } -void -empth_alarm(int sig) -{ - struct sigaction act; - empth_status("got alarm signal"); -#ifdef SA_RESTART - act.sa_flags &= ~SA_RESTART; -#endif - sigemptyset(&act.sa_mask); - act.sa_handler = empth_alarm; - sigaction(SIGALRM, &act, NULL); -} - void empth_wakeup(empth_t *a) {