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.
This commit is contained in:
rsc 2004-12-28 22:36:24 +00:00
parent 07bda1263e
commit 1d2533d010
6 changed files with 36 additions and 8 deletions

View file

@ -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();
}
/*