summaryrefslogtreecommitdiff
path: root/src/thread/pthread_create.c
AgeCommit message (Collapse)AuthorLines
2011-03-20global cleanup to use the new syscall interfaceRich Felker-1/+1
2011-03-19syscall overhaul part two - unify public and internal syscall interfaceRich Felker-3/+3
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.
2011-03-19overhaul syscall interfaceRich Felker-2/+2
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.
2011-03-16cut out a syscall on thread creation in the case where guard size is 0Rich Felker-1/+1
2011-03-12implement flockfile api, rework stdio lockingRich Felker-0/+1
2011-03-10optimize pthread termination in the non-detached caseRich Felker-4/+15
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.
2011-03-10security fix: check that cancel/rsyscall signal was sent by the process itselfRich Felker-0/+3
2011-02-19use rt_sigprocmask, not legacy sigprocmask, syscall in pthread exit codeRich Felker-1/+1
2011-02-19race condition fix: block all signals before decrementing thread countRich Felker-0/+2
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.
2011-02-19make pthread_exit run dtors for last thread, wait to decrement thread countRich Felker-3/+3
2011-02-17reorganize pthread data structures and move the definitions to alltypes.hRich Felker-3/+3
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.
2011-02-15begin unifying clone/thread management interface in preparation for portingRich Felker-4/+2
2011-02-15make pthread_create return EAGAIN on resource failure, as required by POSIXRich Felker-1/+1
2011-02-13reorganize thread exit code, make pthread_exit call cancellation handlers (pt2)Rich Felker-13/+50
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+189