diff options
Diffstat (limited to 'src/libthread')
-rw-r--r-- | src/libthread/create.c | 1 | ||||
-rw-r--r-- | src/libthread/id.c | 12 | ||||
-rw-r--r-- | src/libthread/tprimes.c | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/libthread/create.c b/src/libthread/create.c index a8647f94..b63fee44 100644 --- a/src/libthread/create.c +++ b/src/libthread/create.c @@ -155,6 +155,7 @@ _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++; diff --git a/src/libthread/id.c b/src/libthread/id.c index 727798d3..e920b87b 100644 --- a/src/libthread/id.c +++ b/src/libthread/id.c @@ -52,20 +52,20 @@ threadgetgrp(void) } void -threadsetname(char *name) +threadsetname(char *fmt, ...) { -/* - int fd, n; - char buf[128], *s; -*/ Proc *p; Thread *t; + va_list arg; p = _threadgetproc(); t = p->thread; if (t->cmdname) free(t->cmdname); - t->cmdname = strdup(name); + va_start(arg, fmt); + t->cmdname = vsmprint(fmt, arg); + va_end(fmt); + /* Plan 9 only if(p->nthreads == 1){ snprint(buf, sizeof buf, "#p/%d/args", getpid()); diff --git a/src/libthread/tprimes.c b/src/libthread/tprimes.c index e028f982..89d30c03 100644 --- a/src/libthread/tprimes.c +++ b/src/libthread/tprimes.c @@ -52,7 +52,7 @@ threadmain(int argc, char **argv) buffer = atoi(ARGF()); break; case 'p': - fn=proccreate; + fn = proccreate; break; }ARGEND |