Add futexes for OpenBSD

This commit is contained in:
Justine Tunney 2022-06-21 05:11:51 -07:00
parent 1216b6e7c7
commit b8e9f71d33
4 changed files with 46 additions and 8 deletions

View file

@ -40,7 +40,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() &&
if ((IsLinux() || IsOpenbsd()) &&
atomic_load_explicit(&mutex->waits, memory_order_relaxed)) {
_pthread_mutex_wake(mutex);
}