From 8cbd854a8ab2c4f8c738c5bea5263217cb892a77 Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 27 Dec 2004 19:11:33 +0000 Subject: better exec handling --- src/libthread/Linux.c | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'src/libthread/Linux.c') diff --git a/src/libthread/Linux.c b/src/libthread/Linux.c index d6d31afa..357e9260 100644 --- a/src/libthread/Linux.c +++ b/src/libthread/Linux.c @@ -99,13 +99,15 @@ again: sigdelset(&mask, SIGUSR1); sigsuspend(&mask); +//print("%d %d awake again\n", time(0), getpid()); + /* * We're awake. Make USR1 not interrupt system calls. */ lock(r->l); ignusr1(1); if(r->asleep && r->pid == getpid()){ -print("resleep %d\n", getpid()); +//print("resleep %d\n", getpid()); /* Didn't really wake up - signal from something else */ goto again; } @@ -265,35 +267,6 @@ threadexitsall(char *msg) exits(msg); } -/* - * exec - need to arrange for wait proc to run - * the execs so it gets the wait messages - */ -int -_runthreadspawn(int *fd, char *cmd, char **argv) -{ - Execjob e; - int pid; - - e.fd = fd; - e.cmd = cmd; - e.argv = argv; - e.c = chancreate(sizeof(ulong), 0); -print("%d run\n", time(0)); - qlock(&_threadexeclock); - sendp(_threadexecchan, &e); -print("%d sent\n", time(0)); - while(_threadexecproc == nil) - yield(); - kill(_threadexecproc->osprocid, SIGUSR2); -print("%d killed\n", time(0)); - pid = recvul(e.c); - qunlock(&_threadexeclock); -print("%d ran\n", time(0)); - return pid; -} - - /* * per-process data, indexed by pid * -- cgit v1.2.3