Use futexes on OpenBSD and improve threading

This commit is contained in:
Justine Tunney 2022-07-17 19:59:49 -07:00
parent 5b11033d4d
commit 4f4889ddf7
17 changed files with 114 additions and 63 deletions

View file

@ -44,7 +44,7 @@ int(pthread_mutex_unlock)(pthread_mutex_t *mutex) {
// fallthrough
case PTHREAD_MUTEX_NORMAL:
atomic_store_explicit(&mutex->lock, 0, memory_order_relaxed);
if ((IsLinux() /* || IsOpenbsd() */) &&
if ((IsLinux() || IsOpenbsd()) &&
atomic_load_explicit(&mutex->waits, memory_order_relaxed) > 0) {
_pthread_mutex_wake(mutex);
}