From cf4f3eafc6016ccdb57773215dcdd5ebac95c07d Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 8 Nov 2004 16:03:42 +0000 Subject: extra files --- src/libthread/exit-getpid.ch | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/libthread/exit-getpid.ch (limited to 'src/libthread/exit-getpid.ch') diff --git a/src/libthread/exit-getpid.ch b/src/libthread/exit-getpid.ch new file mode 100644 index 00000000..e2580ac7 --- /dev/null +++ b/src/libthread/exit-getpid.ch @@ -0,0 +1,25 @@ +/* + * Implement threadexitsall by sending a signal to every proc. + * + * To be included from another C file (e.g., Linux-clone.c). + */ + +void +_threadexitallproc(char *exitstr) +{ + Proc *p; + int mypid; + + mypid = getpid(); + lock(&_threadpq.lock); + for(p=_threadpq.head; p; p=p->next) + if(p->pid > 1 && p->pid != mypid) + kill(p->pid, SIGUSR2); + exits(exitstr); +} + +void +_threadexitproc(char *exitstr) +{ + _exits(exitstr); +} -- cgit v1.2.3