aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/exec-unix.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-11-08 16:03:20 +0000
committerrsc <devnull@localhost>2004-11-08 16:03:20 +0000
commit195645536743aeb99eb336726823c38716cec02d (patch)
treeaccb04698efde81ad1228adfddcea695d544ca25 /src/libthread/exec-unix.c
parent77dcf88474c55e040940be8a5f9e7fa1537af564 (diff)
downloadplan9port-195645536743aeb99eb336726823c38716cec02d.tar.gz
plan9port-195645536743aeb99eb336726823c38716cec02d.tar.bz2
plan9port-195645536743aeb99eb336726823c38716cec02d.zip
more thread work
Diffstat (limited to 'src/libthread/exec-unix.c')
-rw-r--r--src/libthread/exec-unix.c18
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);
}