| Commit message (Expand) | Author | Age | Files | Lines |
| * | fix misspelled PTHREAD_CANCELED constant | Rich Felker | 2011-04-01 | 1 | -1/+1 |
| * | major improvements to cancellation handling•••- there is no longer any risk of spoofing cancellation requests, since
the cancel flag is set in pthread_cancel rather than in the signal
handler.
- cancellation signal is no longer unblocked when running the
cancellation handlers. instead, pthread_create will cause any new
threads created from a cancellation handler to unblock their own
cancellation signal.
- various tweaks in preparation for POSIX timer support.
| Rich Felker | 2011-03-29 | 1 | -6/+12 |
| * | match glibc/lsb cancellation abi on i386•••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.
| Rich Felker | 2011-03-25 | 1 | -0/+5 |
| * | overhaul cancellation to fix resource leaks and dangerous behavior with signals•••this commit addresses two issues:
1. a race condition, whereby a cancellation request occurring after a
syscall returned from kernelspace but before the subsequent
CANCELPT_END would cause cancellable resource-allocating syscalls
(like open) to leak resources.
2. signal handlers invoked while the thread was blocked at a
cancellation point behaved as if asynchronous cancellation mode wer in
effect, resulting in potentially dangerous state corruption if a
cancellation request occurs.
the glibc/nptl implementation of threads shares both of these issues.
with this commit, both are fixed. however, cancellation points
encountered in a signal handler will not be acted upon if the signal
was received while the thread was already at a cancellation point.
they will of course be acted upon after the signal handler returns, so
in real-world usage where signal handlers quickly return, it should
not be a problem. it's possible to solve this problem too by having
sigaction() wrap all signal handlers with a function that uses a
pthread_cleanup handler to catch cancellation, patch up the saved
context, and return into the cancellable function that will catch and
act upon the cancellation. however that would be a lot of complexity
for minimal if any benefit...
| Rich Felker | 2011-03-24 | 1 | -5/+11 |
| * | global cleanup to use the new syscall interface | Rich Felker | 2011-03-20 | 1 | -1/+1 |
| * | syscall overhaul part two - unify public and internal syscall interface•••with this patch, the syscallN() functions are no longer needed; a
variadic syscall() macro allows syscalls with anywhere from 0 to 6
arguments to be made with a single macro name. also, manually casting
each non-integer argument with (long) is no longer necessary; the
casts are hidden in the macros.
some source files which depended on being able to define the old macro
SYSCALL_RETURNS_ERRNO have been modified to directly use __syscall()
instead of syscall(). references to SYSCALL_SIGSET_SIZE and SYSCALL_LL
have also been changed.
x86_64 has not been tested, and may need a follow-up commit to fix any
minor bugs/oversights.
| Rich Felker | 2011-03-19 | 1 | -3/+3 |
| * | overhaul syscall interface•••this commit shuffles around the location of syscall definitions so
that we can make a syscall() library function with both SYS_* and
__NR_* style syscall names available to user applications, provides
the syscall() library function, and optimizes the code that performs
the actual inline syscalls in the library itself.
previously on i386 when built as PIC (shared library), syscalls were
incurring bus lock (lock prefix) overhead at entry and exit, due to
the way the ebx register was being loaded (xchg instruction with a
memory operand). now the xchg takes place between two registers.
further cleanup to arch/$(ARCH)/syscall.h is planned.
| Rich Felker | 2011-03-19 | 1 | -2/+2 |
| * | cut out a syscall on thread creation in the case where guard size is 0 | Rich Felker | 2011-03-16 | 1 | -1/+1 |
| * | implement flockfile api, rework stdio locking | Rich Felker | 2011-03-12 | 1 | -0/+1 |
| * | optimize pthread termination in the non-detached case•••we can avoid blocking signals by simply using a flag to mark that the
thread has exited and prevent it from getting counted in the rsyscall
signal-pingpong. this restores the original pthread create/join
throughput from before the sigprocmask call was added.
| Rich Felker | 2011-03-10 | 1 | -4/+15 |
| * | security fix: check that cancel/rsyscall signal was sent by the process itself | Rich Felker | 2011-03-10 | 1 | -0/+3 |
| * | use rt_sigprocmask, not legacy sigprocmask, syscall in pthread exit code | Rich Felker | 2011-02-19 | 1 | -1/+1 |
| * | race condition fix: block all signals before decrementing thread count•••the existence of a (kernelspace) thread must never have observable
effects after the thread count is decremented. if signals are not
blocked, it could end up handling the signal for rsyscall and
contributing towards the count of threads which have changed ids,
causing a thread to be missed. this could lead to one thread retaining
unwanted privilege level.
this change may also address other subtle race conditions in
application code that uses signals.
| Rich Felker | 2011-02-19 | 1 | -0/+2 |
| * | make pthread_exit run dtors for last thread, wait to decrement thread count | Rich Felker | 2011-02-19 | 1 | -3/+3 |
| * | reorganize pthread data structures and move the definitions to alltypes.h•••this allows sys/types.h to provide the pthread types, as required by
POSIX. this design also facilitates forcing ABI-compatible sizes in
the arch-specific alltypes.h, while eliminating the need for
developers changing the internals of the pthread types to poke around
with arch-specific headers they may not be able to test.
| Rich Felker | 2011-02-17 | 1 | -3/+3 |
| * | begin unifying clone/thread management interface in preparation for porting | Rich Felker | 2011-02-15 | 1 | -4/+2 |
| * | make pthread_create return EAGAIN on resource failure, as required by POSIX | Rich Felker | 2011-02-15 | 1 | -1/+1 |
| * | reorganize thread exit code, make pthread_exit call cancellation handlers (pt2) | Rich Felker | 2011-02-13 | 1 | -13/+50 |
| * | initial check-in, version 0.5.0 | Rich Felker | 2011-02-12 | 1 | -0/+189 |