URI: 
       tdifferent fix - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit f19d56825d36b224a376b4012c7656871d9b1535
   DIR parent d407972b54c11282a62788f5d1812ac6603c4234
  HTML Author: rsc <devnull@localhost>
       Date:   Thu, 28 Jul 2005 12:43:41 +0000
       
       different fix
       
       Diffstat:
         M src/libthread/BSD.c                 |       7 ++++++-
         M src/libthread/Linux.c               |      10 ++++++----
       
       2 files changed, 12 insertions(+), 5 deletions(-)
       ---
   DIR diff --git a/src/libthread/BSD.c b/src/libthread/BSD.c
       t@@ -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
       t@@ -296,7 +299,9 @@ threadexitsall(char *msg)
                 */
                {
                        static Lock onelock;
       -                lock(&onelock);
       +                if(!canlock(&onelock))
       +                        _exits(threadexitsmsg);
       +                threadexitsmsg = msg;
                }
        
                if(msg == nil)
   DIR diff --git a/src/libthread/Linux.c b/src/libthread/Linux.c
       t@@ -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
       t@@ -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)