aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/thread.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-28 22:36:24 +0000
committerrsc <devnull@localhost>2004-12-28 22:36:24 +0000
commit1d2533d0101fd1721ab26837485c0b094205c3bd (patch)
tree5f363ff675fa16e800333f2e9ac81e4ecc3636d3 /src/libthread/thread.c
parent07bda1263eb4e319e9d8b278e81d75f67a417b66 (diff)
downloadplan9port-1d2533d0101fd1721ab26837485c0b094205c3bd.tar.gz
plan9port-1d2533d0101fd1721ab26837485c0b094205c3bd.tar.bz2
plan9port-1d2533d0101fd1721ab26837485c0b094205c3bd.zip
restore old plan 9 property that when the
last thread exits the main proc, the remaining program ends up in the background and the program appears to have exited.
Diffstat (limited to 'src/libthread/thread.c')
-rw-r--r--src/libthread/thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libthread/thread.c b/src/libthread/thread.c
index 92e93940..84e21717 100644
--- a/src/libthread/thread.c
+++ b/src/libthread/thread.c
@@ -476,6 +476,8 @@ main(int argc, char **argv)
{
Proc *p;
+ argv0 = argv[0];
+
_threadsetupdaemonize();
threadargc = argc;
@@ -503,7 +505,8 @@ main(int argc, char **argv)
mainstacksize = 65536;
_threadcreate(p, threadmainstart, nil, mainstacksize);
scheduler(p);
- return 0; /* not reached */
+ threaddaemonize();
+ _threadpexit();
}
/*