From f19d56825d36b224a376b4012c7656871d9b1535 Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 28 Jul 2005 12:43:41 +0000 Subject: different fix --- src/libthread/Linux.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/libthread/Linux.c') diff --git a/src/libthread/Linux.c b/src/libthread/Linux.c index 14698856..dab12d3f 100644 --- a/src/libthread/Linux.c +++ b/src/libthread/Linux.c @@ -311,6 +311,9 @@ threadexitsall(char *msg) int i, npid, mypid; Proc *p; + if(msg == nil) + msg = ""; + /* * Only one guy, ever, gets to run this. * If two guys do it, inevitably they end up @@ -322,14 +325,13 @@ threadexitsall(char *msg) */ { static Lock onelock; - lock(&onelock); + if(!canlock(&onelock)) + _exits(threadexitsmsg); + threadexitsmsg = msg; } - if(msg == nil) - msg = ""; mypid = getpid(); lock(&_threadprocslock); - threadexitsmsg = msg; npid = 0; for(p=_threadprocs; p; p=p->next) if(p->osprocid != mypid && p->osprocid >= 1) -- cgit v1.2.3