From d1f7b6d6058fadd65e506ebb78cf2f0bf59c1819 Mon Sep 17 00:00:00 2001 From: davidxu Date: Sun, 8 Jan 2006 01:49:31 +0000 Subject: Allow background threads to be suspended. --- lib/libthr/thread/thr_timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libthr/thread/thr_timer.c') diff --git a/lib/libthr/thread/thr_timer.c b/lib/libthr/thread/thr_timer.c index c5f204e..7e3fba0 100644 --- a/lib/libthr/thread/thr_timer.c +++ b/lib/libthr/thread/thr_timer.c @@ -97,7 +97,7 @@ __weak_reference(__mq_notify, _mq_notify); __weak_reference(___mq_close, mq_close); __weak_reference(___mq_close, _mq_close); -#define SIGSERVICE SIGCANCEL /* Reuse SIGCANCEL */ +#define SIGSERVICE (SIGCANCEL+1) #define RT_WORKING 0x01 #define RT_WANTED 0x02 @@ -478,6 +478,9 @@ service_loop(void *arg) setjmp(tn->tn_jbuf); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); sigemptyset(&set); + sigaddset(&set, SIGCANCEL); + __sys_sigprocmask(SIG_UNBLOCK, &set, NULL); + sigdelset(&set, SIGCANCEL); sigaddset(&set, SIGSERVICE); THR_CLEANUP_PUSH(curthread, thread_cleanup, tn); while (tn->tn_exit == 0) { -- cgit v1.1