#
568eb77e |
| 10-Apr-2022 |
riastradh <riastradh@NetBSD.org> |
pthread: Nix trailing whitespace.
|
#
9c2964a9 |
| 10-Mar-2021 |
christos <christos@NetBSD.org> |
Use __pthread_volatile for ptc_waiters (Greg A. Woods)
|
#
62e0939e |
| 10-Jun-2020 |
ad <ad@NetBSD.org> |
- Make pthread_condvar and pthread_mutex work on the stack rather than in pthread_t, so there's less chance of bad things happening if someone calls (for example) pthread_cond_broadcast() from a
- Make pthread_condvar and pthread_mutex work on the stack rather than in pthread_t, so there's less chance of bad things happening if someone calls (for example) pthread_cond_broadcast() from a signal handler.
- Remove all the deferred waiter handling except for the one case that really matters which is transferring waiters from condvar -> mutex on wakeup, and do that by splicing the condvar's waiters onto the mutex.
- Remove the mutex waiters bit as it's another complication that's not strictly needed.
show more ...
|
#
06d492d1 |
| 01-Jun-2020 |
ad <ad@NetBSD.org> |
In the interests of reliability simplify waiter handling more and redo condvars to manage the list of waiters with atomic ops.
|
#
133682b8 |
| 09-Sep-2017 |
kamil <kamil@NetBSD.org> |
Support <pthread_typs.h> on C89 compilers
Clang 5.0.0(svn) reports warnings on <pthread_types.h> for C99 constructs when used with strict -std=c89.
Restrict designated initializers usage to C99 or
Support <pthread_typs.h> on C89 compilers
Clang 5.0.0(svn) reports warnings on <pthread_types.h> for C99 constructs when used with strict -std=c89.
Restrict designated initializers usage to C99 or newer code. C89 and C++ will share the same code without extension of designated initializers.
PR 52285
show more ...
|
#
285a8995 |
| 20-Jul-2016 |
christos <christos@NetBSD.org> |
unnamed unions need special treatment since they need braced initializers for old style initializations.
|
#
35394698 |
| 20-Jul-2016 |
christos <christos@NetBSD.org> |
cplusplus does not like complex named initializers...
|
#
b826eda4 |
| 20-Jul-2016 |
christos <christos@NetBSD.org> |
use named initializers
|
#
3b2c691c |
| 17-Jul-2016 |
skrll <skrll@NetBSD.org> |
Use anonymous union for ptm_ceiling and old __pthread_spin_t field to maintain backward compatibility and fix hppa build. hppa has an non- integer type __pthread_spin_t
|
#
7cf7644f |
| 03-Jul-2016 |
christos <christos@NetBSD.org> |
GSoC 2016 Charles Cui: Implement thread priority protection based on work by Andy Doran. Also document the get/set pshared thread calls as not implemented, and add a skeleton implementation that is d
GSoC 2016 Charles Cui: Implement thread priority protection based on work by Andy Doran. Also document the get/set pshared thread calls as not implemented, and add a skeleton implementation that is disabled. XXX: document _sched_protect(2).
show more ...
|
#
01d7ebdd |
| 27-Aug-2015 |
pooka <pooka@NetBSD.org> |
Fix PTHREAD_FOO_INITIALIZER for C++ by not using volatile in the relevant pthread types in C++ builds, attempt 2.
The problem with attempt 1 was making assumptions of what the MD __cpu_simple_lock_t
Fix PTHREAD_FOO_INITIALIZER for C++ by not using volatile in the relevant pthread types in C++ builds, attempt 2.
The problem with attempt 1 was making assumptions of what the MD __cpu_simple_lock_t (declared volatile) looks like. To get a same type except non-volatile, we change the MD type to __cpu_simple_lock_nv_t and typedef __cpu_simple_lock_t as a volatile __cpu_simple_lock_nv_t. IMO, __cpu_simple_lock_t should not be volatile at all, but changing it now is too risky.
Fixes at least Rumprun w/ gcc 5.1/5.2. Furthermore, the mpd application (and possibly others) will no longer require NetBSD-specific patches.
Tested: build.sh for i386, Rumprun for x86_64 w/ gcc 5.2.
Based on the patch from Christos in lib/49989.
show more ...
|
#
a83d5ed5 |
| 26-Jun-2015 |
pooka <pooka@NetBSD.org> |
Rev 1.14 was nice except it didn't work with _INITIALIZER, which sort of negates the whole point ... so revert everything while in drawing board mode.
|
#
24bdf1ef |
| 26-Jun-2015 |
pooka <pooka@NetBSD.org> |
Don't depend on __CPU_SIMPLE_LOCK_PAD to determine the type of __cpu_simple_lock_t (because it doesn't). Instead, use sizeof/alignof with a struct { uchar[] }.
Fixes problem in previous commit, cau
Don't depend on __CPU_SIMPLE_LOCK_PAD to determine the type of __cpu_simple_lock_t (because it doesn't). Instead, use sizeof/alignof with a struct { uchar[] }.
Fixes problem in previous commit, caught by Nick Hudson.
show more ...
|
#
7cc7e657 |
| 26-Jun-2015 |
pooka <pooka@NetBSD.org> |
C++ (namely libc++) expects to be using PTHREAD_FOO_INITIALIZER as a member initializer. This does not work for volatile types. Since C++ does not touch the guts of those types, redefine them as non-
C++ (namely libc++) expects to be using PTHREAD_FOO_INITIALIZER as a member initializer. This does not work for volatile types. Since C++ does not touch the guts of those types, redefine them as non-volatile.
Fixes libc++ compilation with g++ 5.1, as reported in PR lib/49989.
show more ...
|
#
2b0c4dcf |
| 02-Aug-2008 |
matt <matt@NetBSD.org> |
Change pthread_mutex_t to use the amount of space as and be congruent to the version used in the SA version of pthreads. This preserves binary compatibility between both versions of the library.
|
#
271002f5 |
| 05-Jun-2008 |
ad <ad@NetBSD.org> |
Back out previous because it breaks the build.
|
#
b4ad7b01 |
| 05-Jun-2008 |
ad <ad@NetBSD.org> |
glibc compatibile PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, requested by rafal@.
|
#
ce099b40 |
| 28-Apr-2008 |
martin <martin@NetBSD.org> |
Remove clause 3 and 4 from TNF licenses
|
#
377f098a |
| 14-Feb-2008 |
ad <ad@NetBSD.org> |
Adjust mutex/rwlock definitions to match reality now that there is only one implementation of each. PR lib/38030.
|
#
8ccc6e06 |
| 07-Sep-2007 |
ad <ad@NetBSD.org> |
- Don't take the mutex's spinlock (ptr_interlock) in pthread_cond_wait(). Instead, make the deferred wakeup list a per-thread array and pass down the lwpid_t's that way.
- In pthread_cond_wait()
- Don't take the mutex's spinlock (ptr_interlock) in pthread_cond_wait(). Instead, make the deferred wakeup list a per-thread array and pass down the lwpid_t's that way.
- In pthread_cond_wait(), take the mutex before dealing with early wakeup. In this way there should never be contention on the CV's spinlock if the app follows POSIX rules (there should only be contention on the user-provided mutex).
- Add a port of the kernel's rwlocks. The rwlock's spinlock is only taken if there is contention. This is enabled where atomic ops are available. Right now that is only i386 and amd64 because I don't have other hardware to test with. It's trivial to add stubs for other architectures as long as they have compare-and-swap. When we have proper atomic ops the old rwlock code can be removed.
- Add a new mutex implementation that's similar to the kernel's mutexes, but uses compare-and-swap to maintain the waiters list, so no spinlocks are involved. Same caveats apply as for the rwlocks.
show more ...
|
#
50fa8db4 |
| 04-Aug-2007 |
ad <ad@NetBSD.org> |
Some significant performance improvements, and a fix for a race with pthread detach/join.
- Make mutex acquire spin for a short time, as done with spinlocks. - Make the number of spins controllable
Some significant performance improvements, and a fix for a race with pthread detach/join.
- Make mutex acquire spin for a short time, as done with spinlocks. - Make the number of spins controllable with the env var PTHREAD_NSPINS. - Reduce the amount of time that libpthread internal spinlocks are held. - Rely more on the barrier effects of park/unpark to avoid taking spinlocks. - Simplify the locking around pthreads and the global queues. - Align per-thread sync data on a 128 byte boundary. - Offset thread stacks by a small amount to try and reduce cache thrash.
show more ...
|
#
e7c35aab |
| 02-May-2007 |
ad <ad@NetBSD.org> |
Remove obsolete comment.
|
#
98391738 |
| 26-Sep-2003 |
nathanw <nathanw@NetBSD.org> |
Don't include <machine/lock.h> anymore; instead, we now get __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED from <sys/types.h>. Should prevent the massive namespace pollution by way of dragging in m
Don't include <machine/lock.h> anymore; instead, we now get __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED from <sys/types.h>. Should prevent the massive namespace pollution by way of dragging in many MD headers that has been observed to break stuff.
show more ...
|
#
c541f9e5 |
| 17-Jul-2003 |
nathanw <nathanw@NetBSD.org> |
Prepare for inclusion in sys/types.h by ensuring that all the symbols defined end with _t or start with _[A-Z_].
|
#
9ff1e2d3 |
| 25-Jan-2003 |
nathanw <nathanw@NetBSD.org> |
Make pthread_barrier_wait() handle spurious wakeups from pthread__block() by adding a generation number to the barrier structure and incrementing it when the barrier fires.
XXX this is an ABI change
Make pthread_barrier_wait() handle spurious wakeups from pthread__block() by adding a generation number to the barrier structure and incrementing it when the barrier fires.
XXX this is an ABI change for anything using barriers, but the library is new enough and nothing in the tree uses barriers so I'm going to let it slide. Using the private data pointer for a field that will always be present would be excessive.
show more ...
|