aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/threadimpl.h
Commit message (Collapse)AuthorAgeFilesLines
* libthread: drop schedlockRuss Cox2020-12-301-1/+0
| | | | Having two locks in the proc was causing deadlocks.
* libthread: simplifyRuss Cox2020-12-301-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.
* libthread: fix pthreadperthread bugsRuss Cox2020-12-301-0/+1
|
* libthread: use libc functions in ucontext for macOS (#417)Xiao-Yong2020-06-151-35/+1
|
* libthread: add pthreadperthread mode and use under ASANRuss Cox2020-05-171-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.
* libthread: use consistent stack calculation code in makecontextRuss Cox2020-01-191-0/+3
| | | | | | Also reduce duplication: makecontext is per-arch not per-os-arch. May fix #353.
* libthread: rm unused sparc-ucontext.hRuss Cox2020-01-191-14/+0
| | | | More dead code.
* libthread: rm FreeBSD 4 codeRuss Cox2020-01-191-9/+0
| | | | Pretty sure FreeBSD 4 is gone now. :-)
* libthread: use mmap to allocate OpenBSD stacksRuss Cox2020-01-141-0/+2
| | | | | | | Should fix faults on OpenBSD. Fixes #218. Fixes #226.
* libthread: fix fault in teardown of procRuss Cox2020-01-131-1/+1
| | | | Fixes #332.
* libthread: run first thread in proc on system stackRuss Cox2020-01-121-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.
* Trivial changes: whitespace and modes.Dan Cross2020-01-101-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>
* libthread: add threadspawndRuss Cox2012-10-221-2/+3
| | | | | R=rsc http://codereview.appspot.com/6742064
* openbsd updates (thanks Pascal Stumpf)Russ Cox2012-07-141-0/+2
| | | | | R=rsc http://codereview.appspot.com/6401049
* OS X PowerPC fixes (thanks Cameron Kaiser)Russ Cox2011-10-231-1/+1
|
* libthread: Lion context routinesRuss Cox2011-10-131-2/+4
|
* build: OS X 64-bit buildRuss Cox2011-08-021-4/+15
| | | | | R=rsc http://codereview.appspot.com/4838047
* arm: build fixesRichard Miller2011-05-181-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
* libthread: context switching for arm, still not completeRuss Cox2009-11-181-4/+4
|
* INSTALL: fix build on Snow LeopardRuss Cox2009-09-111-0/+3
| | | | http://codereview.appspot.com/116073
* libthread: use our own swapcontext/makecontext even on OS X 10.5Russ Cox2007-11-051-1/+10
|
* libthread: better OS X 10.5 test (Jeff Sickel)Russ Cox2007-11-031-1/+1
|
* libthread: Apple OS X 10.5 (Leopard) tweaks (Jeff Sickel, Bakul Shah)Russ Cox2007-10-301-1/+1
|
* libthread: simplify alt tracking, possibly fixing bugRuss Cox2007-08-221-0/+1
|
* use standard sun context routinesrsc2007-05-011-0/+6
|
* pinrsc2006-06-261-0/+1
|
* set RFNOTEG when we canrsc2006-06-041-0/+9
|
* darwin 386 startrsc2006-04-211-1/+5
|
* add threadidlersc2006-02-071-0/+1
|
* constrsc2005-11-041-1/+1
|
* try againrsc2005-11-041-2/+4
|
* try arm againrsc2005-11-041-0/+5
|
* use macro for getcontext (setjmp)rsc2005-11-041-2/+4
|
* FreeBSD changed!rsc2005-11-011-1/+1
|
* openbsdrsc2005-07-201-0/+4
|
* openbsdrsc2005-07-191-2/+6
|
* OpenBSD/power support.rsc2005-05-011-2/+9
|
* add threaddatarsc2005-03-181-0/+1
|
* different fix for main proc bugrsc2005-02-141-0/+1
|
* osprocid can be -1rsc2005-01-301-1/+1
|
* allow config to override kernel versionrsc2005-01-171-0/+1
|
* os x changesrsc2005-01-111-0/+4
|
* initial darwinrsc2005-01-071-0/+4
|
* add _procwakeupandunlockrsc2005-01-061-0/+1
| | | | | to help ease locking contention on Linux 2.4.
* add _threaddaemonizersc2005-01-041-0/+1
|
* Use FreeBSD-approved method for determining FreeBSD version.wkj2004-12-291-1/+1
|
* restore old plan 9 property that when thersc2004-12-281-0/+1
| | | | | | last thread exits the main proc, the remaining program ends up in the background and the program appears to have exited.
* more freebsd workrsc2004-12-281-0/+16
|
* add threaddaemonize(), more bug fixesrsc2004-12-281-2/+2
|
* better exec handlingrsc2004-12-271-0/+1
|