diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-06 05:03:35 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-06 05:03:35 +0100 |
commit | 6e1c833585a78e534a0b4a7c990faba7d4dcdd45 (patch) | |
tree | 111e6b11e4b8ebd0e972fc8d787d8c96b61f47f5 /sys/src/libthread | |
parent | f6887b0a3c0a18c59721ea5a006a1c31b3604591 (diff) |
libthread: avoid calling thread waiting for fork/execed process to finish if we dont have to
we do not need to wait for fork/execed program to finish when
not collecting waitmsg. this reduces the number of rio
processes hanging arround for each window shell just waiting
for it to terminate and then dumping the waitmsg.
Diffstat (limited to 'sys/src/libthread')
-rw-r--r-- | sys/src/libthread/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/src/libthread/main.c b/sys/src/libthread/main.c index 1dcd9c319..03c069c14 100644 --- a/sys/src/libthread/main.c +++ b/sys/src/libthread/main.c @@ -121,9 +121,10 @@ efork(Execargs *e) int _schedexec(Execargs *e) { - int pid; + int pid, flag; - switch(pid = rfork(RFREND|RFNOTEG|RFFDG|RFMEM|RFPROC)){ + flag = (_threadwaitchan == nil) ? RFNOWAIT : 0; + switch(pid = rfork(RFREND|RFNOTEG|RFFDG|RFMEM|RFPROC|flag)){ case 0: efork(e); default: |