aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/threadimpl.h
AgeCommit message (Collapse)AuthorFilesLines
2020-12-30libthread: drop schedlockRuss Cox1-1/+0
Having two locks in the proc was causing deadlocks.
2020-12-30libthread: simplifyRuss Cox1-44/+0
Now that everything uses pthreads and pthreadperthread, can delete various conditionals, all the custom context code, and so on. Also update documents. Fixes #355.
2020-12-30libthread: fix pthreadperthread bugsRuss Cox1-0/+1
2020-06-15libthread: use libc functions in ucontext for macOS (#417)Xiao-Yong1-35/+1
2020-05-17libthread: add pthreadperthread mode and use under ASANRuss Cox1-11/+22
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.
2020-01-19libthread: use consistent stack calculation code in makecontextRuss Cox1-0/+3
Also reduce duplication: makecontext is per-arch not per-os-arch. May fix #353.
2020-01-19libthread: rm unused sparc-ucontext.hRuss Cox1-14/+0
More dead code.
2020-01-19libthread: rm FreeBSD 4 codeRuss Cox1-9/+0
Pretty sure FreeBSD 4 is gone now. :-)
2020-01-14libthread: use mmap to allocate OpenBSD stacksRuss Cox1-0/+2
Should fix faults on OpenBSD. Fixes #218. Fixes #226.
2020-01-13libthread: fix fault in teardown of procRuss Cox1-1/+1
Fixes #332.
2020-01-12libthread: run first thread in proc on system stackRuss Cox1-1/+0
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.
2020-01-10Trivial changes: whitespace and modes.Dan Cross1-1/+1
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>
2012-10-22libthread: add threadspawndRuss Cox1-2/+3
R=rsc http://codereview.appspot.com/6742064
2012-07-14openbsd updates (thanks Pascal Stumpf)Russ Cox1-0/+2
R=rsc http://codereview.appspot.com/6401049
2011-10-23OS X PowerPC fixes (thanks Cameron Kaiser)Russ Cox1-1/+1
2011-10-13libthread: Lion context routinesRuss Cox1-2/+4
2011-08-02build: OS X 64-bit buildRuss Cox1-4/+15
R=rsc http://codereview.appspot.com/4838047
2011-05-18arm: build fixesRichard Miller1-4/+4
Get p9p to build cleanly for ARM - based on suggestions from rsc and eekee, plus a final tweak from me. Tested (a bit) on sheevaplug (ubuntu jaunty), Nokia N800 (maemo 4) and Nokia N900 (maemo 5). R=rsc CC=plan9port.codebot http://codereview.appspot.com/4524056
2009-11-18libthread: context switching for arm, still not completeRuss Cox1-4/+4
2009-09-11INSTALL: fix build on Snow LeopardRuss Cox1-0/+3
http://codereview.appspot.com/116073
2007-11-05libthread: use our own swapcontext/makecontext even on OS X 10.5Russ Cox1-1/+10
2007-11-03libthread: better OS X 10.5 test (Jeff Sickel)Russ Cox1-1/+1
2007-10-30libthread: Apple OS X 10.5 (Leopard) tweaks (Jeff Sickel, Bakul Shah)Russ Cox1-1/+1
2007-08-22libthread: simplify alt tracking, possibly fixing bugRuss Cox1-0/+1
2007-05-01use standard sun context routinesrsc1-0/+6
2006-06-26pinrsc1-0/+1
2006-06-04set RFNOTEG when we canrsc1-0/+9
2006-04-21darwin 386 startrsc1-1/+5
2006-02-07add threadidlersc1-0/+1
2005-11-04constrsc1-1/+1
2005-11-04try againrsc1-2/+4
2005-11-04try arm againrsc1-0/+5
2005-11-04use macro for getcontext (setjmp)rsc1-2/+4
2005-11-01FreeBSD changed!rsc1-1/+1
2005-07-20openbsdrsc1-0/+4
2005-07-19openbsdrsc1-2/+6
2005-05-01OpenBSD/power support.rsc1-2/+9
2005-03-18add threaddatarsc1-0/+1
2005-02-14different fix for main proc bugrsc1-0/+1
2005-01-30osprocid can be -1rsc1-1/+1
2005-01-17allow config to override kernel versionrsc1-0/+1
2005-01-11os x changesrsc1-0/+4
2005-01-07initial darwinrsc1-0/+4
2005-01-06add _procwakeupandunlockrsc1-0/+1
to help ease locking contention on Linux 2.4.
2005-01-04add _threaddaemonizersc1-0/+1
2004-12-29Use FreeBSD-approved method for determining FreeBSD version.wkj1-1/+1
2004-12-28restore old plan 9 property that when thersc1-0/+1
last thread exits the main proc, the remaining program ends up in the background and the program appears to have exited.
2004-12-28more freebsd workrsc1-0/+16
2004-12-28add threaddaemonize(), more bug fixesrsc1-2/+2
2004-12-27better exec handlingrsc1-0/+1