* config/linux/wait.h (do_spin): New inline, largely copied from do_wait, just don't do futex_wait here, instead return true if it should be done. (do_wait): Implement using do_spin. * config/linux/mutex.h (gomp_mutex_lock_slow): Add an int argument to prototype. (gomp_mutex_lock): Use __sync_val_compare_and_swap instead of __sync_bool_compare_and_swap, pass the oldval to gomp_mutex_lock_slow. * config/linux/mutex.c (gomp_mutex_lock_slow): Add oldval argument. If all mutex contenders are just spinning and not sleeping, don't change state to 2 unnecessarily. Optimize the loop when state has already become 2 to use just one atomic operation per loop instead of two. * config/linux/ia64/mutex.h (gomp_mutex_lock_slow): Add an int argument to prototype. (gomp_mutex_lock): Use __sync_val_compare_and_swap instead of __sync_bool_compare_and_swap, pass the oldval to gomp_mutex_lock_slow. From-SVN: r176326
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
alpha | Loading commit data... | |
arm | Loading commit data... | |
ia64 | Loading commit data... | |
mips | Loading commit data... | |
powerpc | Loading commit data... | |
s390 | Loading commit data... | |
sparc | Loading commit data... | |
x86 | Loading commit data... | |
affinity.c | Loading commit data... | |
bar.c | Loading commit data... | |
bar.h | Loading commit data... | |
futex.h | Loading commit data... | |
lock.c | Loading commit data... | |
mutex.c | Loading commit data... | |
mutex.h | Loading commit data... | |
omp-lock.h | Loading commit data... | |
proc.c | Loading commit data... | |
ptrlock.c | Loading commit data... | |
ptrlock.h | Loading commit data... | |
sem.c | Loading commit data... | |
sem.h | Loading commit data... | |
wait.h | Loading commit data... |