summaryrefslogtreecommitdiff
path: root/lib/libpthread
AgeCommit message (Collapse)Author
2014-02-03pthread__mutex_lock_slow: fix the handling of a potential race with thermind
non-interlocked CAS in the fast unlock path -- it is unsafe to test for the waiters-bit while the owner thread is running, we have to spin for the owner or its state change to be sure about the presence of the bit. Split off the logic into the pthread__mutex_setwaiters() routine. This is a partial fix to the named lockup problem (also see PR/44756). It seems there is another race which can be reproduced on faster CPUs.
2014-01-31remove compatibility code for handling CLOCK_MONOTONIC and handle it in thechristos
syscall directly.
2014-01-31PR/44756: Sad Clouds: Prevent leakage of errno = ESRCH from _lwp_park. Thischristos
has two parts: - in pthread_cond_timedwait() if the thread we are trying to unpark exited, retry the the _lwp_park call without it. - pthread_mutex() was affecting errno since it is calling _lwp_park() from pthread_mutex_lock_slow(). preserve the original errno. Note that the example problem still causes an occassional deadlock on machines with many CPUs and it is the same deadlock we observe with named.
2013-10-09Use MACHINE_CPU for m68k. Use similar logic for both tests.matt
2013-08-15Add support for an optional ARCHSUBDIR/Makefile.incmatt
2013-08-15Use the thumb1 versions of sev/wfe for thumb && armv6+.matt
if using armv5t don't do anything for thumb.
2013-08-12Some architectures can't create unwind tables without the frame pointer,joerg
so don't use -fomit-frame-pointer on those.
2013-07-20Use Mt for email addresses.wiz
2013-05-10s/inherited/inherit/christos
2013-04-03bump for pthread_cond_setclockchristos
2013-04-01for safety, declare mono on the outermost block it is used.christos
2013-03-28PR/47703: Yasushi Oshima: pthread_cond_timedwait() does not waitchristos
after call pthread_condattr_setclock(CLOCK_MONOTONIC) _lwp_park(2) expects a realtime clock, and it gets passed a monotonic one. Since monotonic < real, it never sleeps. This patch adjusts the monotonic clock to be a real one before it passes is to _lwp_park(2). This is the minimal hacky fix and it will be fixed properly in _lwp_park(2) in the future. XXX: pullup to 6.
2013-03-21- Allow libpthread to be dlopened again, by providing libc stubs to libpthread.christos
- Fail if the dlopened libpthread does pthread_create(). From manu@ - Discussed at length in the mailing lists; approved by core@ - This was chosen as the least intrusive patch that will provide the necessary functionality. XXX: pullup to 6
2013-03-06add commentsyamt
whitespace
2013-03-06add assertionsyamt
2013-02-25Explain what PTHREAD__COMPAT is for. This comment inapb
src/libpthread/Makefile is adated from a comment in src/doc/CHANGES.prev.
2013-01-31Add pthread_condattr_setclock(3) man page link.riastradh
2013-01-01Don't rely on sys/lwp.h includeing sys/resource.h for us.dsl
2012-11-22Don't call the destructor in pthread_key_delete() following the standard.christos
2012-11-21Replace the simple implementation of pthread_key_{create,destroy}christos
and pthread_{g,s}etspecific functions, to one that invalidates values of keys in other threads when pthread_key_delete() is called. This fixes chromium, which expects pthread_key_delete() to do cleanup in all threads.
2012-11-14add argsusedchristos
2012-11-12Mark up (unsupported) PTHREAD_PROCESS_SHARED with .Dv macro.uwe
2012-11-12Refer to init_routine in the DESCRIPTION section with .Fa instead of .Fnuwe
2012-11-12Useuwe
.Vt type var No = Dv INITIALIZER; to provide examples of static initialization in SYNOPSIS section. .Va macro does the wrong thing (check groff PostScript output) and the need for .Pp kludge (now dropped) should have been an indication too. While here move static initialization example to be right after the declaration of *_init().
2012-11-10Each get function "has" a set counterpart, it doesn't "contain" it.uwe
2012-11-06Remove duplicate "const" modifier found by clang -Wduplicate-decl-specifierapb
2012-11-03libpthread: replace the use of obsolete sys/tree.h interface with rbtree(9).rmind
2012-11-03Fix pasto.wiz
2012-11-03add pthread_condattr_setclock(3)christos
2012-11-03cast return of sysconfchristos
2012-09-19Use .inst instead of wfe/sev to shut up gas.matt
2012-09-12Only copy the ucontext_t in pthread_setcontext if _UC_TLSBASE is set.matt
Conditionalize the test on _UC_TLSBASE being defined.
2012-09-12setcontext() used to be incompatible with -lpthread since it affectedmanu
the TLS pointer, therefore wrecking the pthread environement. Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha) that controlled whether setcontext() would change the TLS pointer. This change let libpthread override setcontext() with its own version that unsets _UC_TLSBASE, enabling safe usage of setcontext() with -lpthread. We also have the following required changes here: - rename alpha's _UC_UNIQUE into _UC_TLSBASE - add _UC_TLSBASE definition in header file for all ports (powerpc, sh3, sparc and sparc64 lack the implementation for now) - introduce a libc stub that can be overriden for setcontext() - modify MD libcs swapcontext() implementations so that they use the setcontext() libc stub instead of doing a plain system call. While we are there: - document various MD _UC_* flags in header file - add libc and libpthread tests for swapcontext() behavior (hopefully helpful to spot MD problems introduced with this change) Future work: - Deciding whether kernel support or _UC_TLSBASE should be added for powerpc, sh3, sparc and sparc64 is left to portmasters sparc64 Approved by core@
2012-08-16Add a pthread__smt_wake and add support for it on arm along withmatt
pthread__smt_pause. These are implemented using the ARM instructions SEV (wake) and WFE (pause). These are treated as NOPs on ARM CPUs that don't support them.
2012-08-15return errno if pthread_create hits the system limit, not just -1drochner
(this is not entirely correct because it can return ENOMEM which is not mentioned in the spec, but there are other places in pthread_create whete ENOMEM is returned -- it at all, this should be fixed everywhere)
2012-08-04-Wfoo goes into CWARNFLAGSmatt
2012-08-02Prefer sysconf to obtain number of CPUs.joerg
2012-06-15Do not mark pthread_cond_timedwait explicitly as inlineable, since itjoerg
calls pthread__self, which is static.
2012-05-04Simplify check for TLS definition to not hide code. Drop it in anotherjoerg
place as it is redundant.
2012-04-26Store allocated lwpctl state in the thread actually forked,enami
which is the only thread lives in the child process. The problem originally reported here: https://bugs.ruby-lang.org/issues/6341
2012-04-04trailing whitespace police.christos
2012-04-04Disable new -Wstring-plus-int warning where needed for now.joerg
Adjust various places that add GCC-only options to check for the active compiler first.
2012-04-04Add a pthread cancel stub for sigwait, following Onno van der Linden'sagc
analysis in PR 45131. Kindly tested by Hisashi T Fujinaka (using csup as the test case) with a successful outcome. OK martin@
2012-03-22don't reuse a dynamically allocated stack if a fixed one is requesteddrochner
2012-03-21These directories default to WARNS?=5matt
2012-03-13Move the pthread_once alias where it belongs.joerg
2012-03-12Move pthread_once implementation into a separate file, it doesn't dependjoerg
on the mutex implementation in any way.
2012-03-12Keep track of the size of the guard area, in case we want to make itjoerg
modifiable later. Only reuse the stack if it was allocated by libpthread and if the expected thread size matches the current stack size.
2012-03-12Further refine stack allocation. If the stack was provided by the user,joerg
don't bother with setting up a guard page. Otherwise, round up the size to page size. Point stack inside the guarded area, without the guard page. Fix size when mprotect failed.
2012-03-10Fix error handlingjoerg