diff options
| author | rsc <devnull@localhost> | 2004-02-29 22:10:26 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-02-29 22:10:26 +0000 |
| commit | 5a8e63b2f016735364d17866d5e2bcb35d20c78b (patch) | |
| tree | d5d0ce11e087efaf81c77311bac9d30aed41783d /src/libthread/create.c | |
| parent | d51419bf4397cf13d0c50bf84c125477c6bed307 (diff) | |
| download | plan9port-5a8e63b2f016735364d17866d5e2bcb35d20c78b.tar.gz plan9port-5a8e63b2f016735364d17866d5e2bcb35d20c78b.zip | |
Fighting the good fight.
Move libfmt, libutf into subdirectories of lib9.
Add poll-based socket i/o to libthread, so that we can
avoid using multiple procs when possible, thus removing
dependence on crappy pthreads implementations.
Convert samterm, acme to the single-proc libthread.
Bring libcomplete, acme up-to-date w.r.t. Plan 9 distribution.
Diffstat (limited to 'src/libthread/create.c')
| -rw-r--r-- | src/libthread/create.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libthread/create.c b/src/libthread/create.c index d487e195..518eaae6 100644 --- a/src/libthread/create.c +++ b/src/libthread/create.c @@ -86,6 +86,7 @@ proccreate(void (*f)(void*), void *arg, uint stacksize) p = _threadgetproc(); if(p->idle){ + fprint(2, "cannot create procs once there is an idle thread\n"); werrstr("cannot create procs once there is an idle thread"); return -1; } @@ -124,6 +125,7 @@ threadcreateidle(void (*f)(void *arg), void *arg, uint stacksize) int id; if(_threadprocs!=1){ + fprint(2, "cannot have idle thread in multi-proc program\n"); werrstr("cannot have idle thread in multi-proc program"); return -1; } @@ -153,6 +155,8 @@ _newproc(void (*f)(void *arg), void *arg, uint stacksize, char *name, int grp, i else *_threadpq.tail = p; _threadpq.tail = &p->next; + if(_threadprocs == 1) + _threadmultiproc(); _threadprocs++; unlock(&_threadpq.lock); return p; |
