diff options
author | rsc <devnull@localhost> | 2004-11-08 16:03:42 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-11-08 16:03:42 +0000 |
commit | cf4f3eafc6016ccdb57773215dcdd5ebac95c07d (patch) | |
tree | 8ec61fb34fb6a0fe9d7bd79c65487b9a1ec4bb81 /src/libthread/exit-getpid.ch | |
parent | 195645536743aeb99eb336726823c38716cec02d (diff) | |
download | plan9port-cf4f3eafc6016ccdb57773215dcdd5ebac95c07d.tar.gz plan9port-cf4f3eafc6016ccdb57773215dcdd5ebac95c07d.tar.bz2 plan9port-cf4f3eafc6016ccdb57773215dcdd5ebac95c07d.zip |
extra files
Diffstat (limited to 'src/libthread/exit-getpid.ch')
-rw-r--r-- | src/libthread/exit-getpid.ch | 25 |
1 files changed, 25 insertions, 0 deletions
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); +} |