|author||Rich Felker <email@example.com>||2014-08-18 01:26:16 -0400|
|committer||Rich Felker <firstname.lastname@example.org>||2014-08-18 01:26:16 -0400|
simplify and improve new cond var implementation
previously, wake order could be unpredictable: if a waiter happened to leave its futex wait on the state early, e.g. due to EAGAIN while restarting after a signal handler, it could acquire the mutex out of turn. handling this required ugly O(n) list walking in the unwait function and accounting to remove waiters that already woke from the list. with the new changes, the "barrier" locks in each waiter node are only unlocked in turn. in addition to simplifying the code, this seems to improve performance slightly, probably by reducing the number of accesses threads make to each other's stacks. as an additional benefit, unrecoverable mutex re-locking errors (mainly ENOTRECOVERABLE for robust mutexes) no longer need to be handled with deadlock; they can be reported to the caller, since the unlocking sequence makes it unnecessary to rely on the mutex to synchronize access to the waiter list.
Diffstat (limited to 'arch/sh/pthread_arch.h')
0 files changed, 0 insertions, 0 deletions