Commit Briefs

Russ Cox

libthread: add pthreadperthread mode and use under ASAN

ASAN can't deal with the coroutine stacks. In theory we can call into ASAN runtime to let it know about them, but ASAN still has problems with fork or exit happening from a non-system stack. Bypass all possible problems by just having a full OS thread for each libthread thread. The threads are still cooperatively scheduled within a proc (in thos mode, a group of OS threads). Setting the environment variable LIBTHREAD=pthreadperthread will enable the pthreadperthread mode, as will building with CC9FLAGS='-fsanitize=address' in $PLAN9/config. This solution is much more general than ASAN - for example if you are trying to find all the thread stacks in a reproducible crash you can use pthreadperthread mode with any debugger that knows only about OS threads.


Russ Cox

libthread: fix nbrecvul, recvul to match man page, Plan 9

They return 0 on failure, not -1. Bug introduced in my original libthread-for-Unix code. Fixes #230.


Dan Cross

Trivial changes: whitespace and modes.

Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>



Russ Cox

libthread: input sanity checks



rsc

Many small edits.


rsc

more freebsd work



rsc

more new libthread