diff options
| author | rsc <devnull@localhost> | 2004-09-23 03:01:36 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-09-23 03:01:36 +0000 |
| commit | 7966faa931bfa9cf4ca53dd2d5b6e1eb0f174411 (patch) | |
| tree | cbf2c9099f0d78c2c26aeea687803d43049db521 /src/libthread/exit.c | |
| parent | c6687d4591964cb13df87f55ec4770e778a4a55c (diff) | |
| download | plan9port-7966faa931bfa9cf4ca53dd2d5b6e1eb0f174411.tar.gz plan9port-7966faa931bfa9cf4ca53dd2d5b6e1eb0f174411.zip | |
Continue fighting pthreads.
Clean up thread library a bit too.
Diffstat (limited to 'src/libthread/exit.c')
| -rw-r--r-- | src/libthread/exit.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/libthread/exit.c b/src/libthread/exit.c index f3d4bb8e..79aa7c7f 100644 --- a/src/libthread/exit.c +++ b/src/libthread/exit.c @@ -26,42 +26,13 @@ threadexits(char *exitstr) void threadexitsall(char *exitstr) { - Proc *p; - int *pid; - int i, npid, mypid; - _threaddebug(DBGSCHED, "threadexitsall %s", exitstr); if(exitstr == nil) exitstr = ""; _threadexitsallstatus = exitstr; _threaddebug(DBGSCHED, "_threadexitsallstatus set to %p", _threadexitsallstatus); - mypid = _threadgetpid(); - - /* - * signal others. - * copying all the pids first avoids other thread's - * teardown procedures getting in the way. - */ - lock(&_threadpq.lock); - npid = 0; - for(p=_threadpq.head; p; p=p->next) - npid++; - pid = _threadmalloc(npid*sizeof(pid[0]), 0); - npid = 0; - for(p = _threadpq.head; p; p=p->next) - pid[npid++] = p->pid; - unlock(&_threadpq.lock); - for(i=0; i<npid; i++){ - _threaddebug(DBGSCHED, "threadexitsall kill %d", pid[i]); - if(pid[i]==0 || pid[i]==-1) - fprint(2, "bad pid in threadexitsall: %d\n", pid[i]); - else if(pid[i] != mypid){ - kill(pid[i], SIGTERM); - } - } - /* leave */ - exits(0); + _threadexitallproc(exitstr); } Channel* |
