about summary refs log tree commit diff
path: root/src/thread/cancellation.c
Commit message (Collapse)AuthorAgeFilesLines
* fix pthread_cleanup_pop(1) crash in non-thread-capable, static-linked programsRich Felker2012-02-281-0/+2
|
* small fix for new pthread cleanup stuffRich Felker2012-02-091-0/+1
| | | | | | | even if pthread_create/exit code is not linked, run flag needs to be checked and cleanup function potentially run on pop. thus, move the code to the module that's always linked when pthread_cleanup_push/pop is used.
* replace bad cancellation cleanup abi with a sane oneRich Felker2012-02-091-12/+9
| | | | | | | | | | | | | | | | | | | | | | the old abi was intended to duplicate glibc's abi at the expense of being ugly and slow, but it turns out glib was not even using that abi except on non-gcc-compatible compilers (which it doesn't even support) and was instead using an exceptions-in-c/unwind-based approach whose abi we could not duplicate anyway without nasty dwarf2/unwind integration. the new abi is copied from a very old glibc abi, which seems to still be supported/present in current glibc. it avoids all unwinding, whether by sjlj or exceptions, and merely maintains a linked list of cleanup functions to be called from the context of pthread_exit. i've made some care to ensure that longjmp out of a cleanup function should work, even though it is not required to. this change breaks abi compatibility with programs which were using pthread cancellation, which is unfortunate, but that's why i'm making the change now rather than later. considering that most pthread features have not been usable until recently anyway, i don't see it as a major issue at this point.
* further debloat cancellation handlersRich Felker2011-08-031-14/+4
| | | | | | | cleanup push and pop are also no-ops if pthread_exit is not reachable. this can make a big difference for library code which needs to protect itself against cancellation, but which is unlikely to actually be used in programs with threads/cancellation.
* fix static linking dependency bloat with cancellationRich Felker2011-08-031-0/+12
| | | | | | | previously, pthread_cleanup_push/pop were pulling in all of pthread_create due to dependency on the __pthread_unwind_next function. this was not needed, as cancellation cleanup handlers can never be called unless pthread_exit or pthread_cancel is reachable.
* match glibc/lsb cancellation abi on i386Rich Felker2011-03-251-0/+7
| | | | | | | | glibc made the ridiculous choice to use pass-by-register calling convention for these functions, which is impossible to duplicate directly on non-gcc compilers. instead, we use ugly asm to wrap and convert the calling convention. presumably this works with every compiler anyone could potentially want to use.
* reorganize thread exit code, make pthread_exit call cancellation handlers (pt2)Rich Felker2011-02-131-9/+1
|
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+22