diff options
Diffstat (limited to 'src/libthread/exec-unix.c')
-rw-r--r-- | src/libthread/exec-unix.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/libthread/exec-unix.c b/src/libthread/exec-unix.c index f69fedca..e5848eaa 100644 --- a/src/libthread/exec-unix.c +++ b/src/libthread/exec-unix.c @@ -10,20 +10,9 @@ _threadexec(Channel *pidc, int fd[3], char *prog, char *args[], int freeargs) int pfd[2]; int n, pid; char exitstr[ERRMAX]; - static int firstexec = 1; - static Lock lk; _threaddebug(DBGEXEC, "threadexec %s", prog); - if(firstexec){ - lock(&lk); - if(firstexec){ - firstexec = 0; - _threadfirstexec(); - } - unlock(&lk); - } - /* * We want threadexec to behave like exec; if exec succeeds, * never return, and if it fails, return with errstr set. @@ -53,7 +42,6 @@ _threadexec(Channel *pidc, int fd[3], char *prog, char *args[], int freeargs) _threaddebug(DBGSCHED, "exit after efork"); _exit(0); default: - _threadafterexec(); if(freeargs) free(args); break; @@ -88,14 +76,14 @@ Bad: void threadexec(Channel *pidc, int fd[3], char *prog, char *args[]) { - if(_callthreadexec(pidc, fd, prog, args, 0) >= 0) + if(_kthreadexec(pidc, fd, prog, args, 0) >= 0) threadexits(nil); } int threadspawn(int fd[3], char *prog, char *args[]) { - return _callthreadexec(nil, fd, prog, args, 0); + return _kthreadexec(nil, fd, prog, args, 0); } /* @@ -128,7 +116,7 @@ threadexecl(Channel *pidc, int fd[3], char *f, ...) args[n] = 0; va_end(arg); - if(_callthreadexec(pidc, fd, f, args, 1) >= 0) + if(_kthreadexec(pidc, fd, f, args, 1) >= 0) threadexits(nil); } |