diff options
author | Russ Cox <rsc@swtch.com> | 2020-01-08 22:47:51 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-01-12 15:08:28 -0500 |
commit | 0158bceec78c7891a7ef672770bf42e65fd064dd (patch) | |
tree | d1fd52098775c9b25e67e1497fa3972143c1bd13 /src/libthread/test | |
parent | e0c4896ed41faa71445d9e0b1751aba5157343c9 (diff) | |
download | plan9port-0158bceec78c7891a7ef672770bf42e65fd064dd.tar.gz plan9port-0158bceec78c7891a7ef672770bf42e65fd064dd.tar.bz2 plan9port-0158bceec78c7891a7ef672770bf42e65fd064dd.zip |
libthread: run first thread in proc on system stack
For pthread systems that are fussy about which stack is used,
this makes sure that threadmain runs on a system stack.
If you only use proccreate (never threadcreate), all threads run
on system stacks.
Diffstat (limited to 'src/libthread/test')
-rw-r--r-- | src/libthread/test/tspawnloop.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libthread/test/tspawnloop.c b/src/libthread/test/tspawnloop.c index 05636dc9..204328b8 100644 --- a/src/libthread/test/tspawnloop.c +++ b/src/libthread/test/tspawnloop.c @@ -8,7 +8,7 @@ execproc(void *v) int i, fd[3]; char buf[100], *args[3]; - i = (int)v; + i = (int)(uintptr)v; sprint(buf, "%d", i); fd[0] = dup(0, -1); fd[1] = dup(1, -1); @@ -33,7 +33,7 @@ threadmain(int argc, char **argv) c = threadwaitchan(); for(i=0;; i++){ - proccreate(execproc, (void*)i, 16384); + proccreate(execproc, (void*)(uintptr)i, 16384); w = recvp(c); if(w == nil) sysfatal("exec/recvp failed: %r"); |