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/BSD.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libthread/BSD.c') diff --git a/src/libthread/BSD.c b/src/libthread/BSD.c index 8090ea59..3dbb3b2a 100644 --- a/src/libthread/BSD.c +++ b/src/libthread/BSD.c @@ -285,6 +285,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 @@ -296,7 +299,9 @@ threadexitsall(char *msg) */ { static Lock onelock; - lock(&onelock); + if(!canlock(&onelock)) + _exits(threadexitsmsg); + threadexitsmsg = msg; } if(msg == nil) -- cgit v1.2.3