From 06bb4ed20d855b60e39c1125d8d715ba8892265b Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 17 Sep 2004 00:38:29 +0000 Subject: Rewrite to remove dependence on rendezvous and its bizarre data structures. Makes it easier to use pthreads too. Still need to add code for non-pthreads systems. Just a checkpoint to switch work to another machine. --- src/libthread/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/libthread/main.c') diff --git a/src/libthread/main.c b/src/libthread/main.c index 0a2fccb7..6129f3e0 100644 --- a/src/libthread/main.c +++ b/src/libthread/main.c @@ -40,7 +40,7 @@ main(int argc, char **argv) //_threaddebuglevel = (DBGSCHED|DBGCHAN|DBGREND)^~0; _systhreadinit(); - _qlockinit(_threadrendezvous); + _qlockinit(_threadsleep, _threadwakeup); _sysfatal = _threadsysfatal; notify(_threadnote); if(mainstacksize == 0) @@ -49,8 +49,9 @@ main(int argc, char **argv) a = _threadmalloc(sizeof *a, 1); a->argc = argc; a->argv = argv; - +malloc(10); p = _newproc(mainlauncher, a, mainstacksize, "threadmain", 0, 0); +malloc(10); _schedinit(p); abort(); /* not reached */ return 0; @@ -61,7 +62,9 @@ mainlauncher(void *arg) { Mainarg *a; +malloc(10); a = arg; +malloc(10); threadmain(a->argc, a->argv); threadexits("threadmain"); } -- cgit v1.2.3