Use FUTEX_WAIT_BITSET to avoid converting timeouts.
Add unittests for pthread APIs with timeout parameter.
Bug: 17569991
Change-Id: I6b3b9b2feae03680654cd64c3112ce7644632c87
diff --git a/libc/private/bionic_lock.h b/libc/private/bionic_lock.h
index a36d1ed..eb73274 100644
--- a/libc/private/bionic_lock.h
+++ b/libc/private/bionic_lock.h
@@ -57,7 +57,7 @@
}
while (atomic_exchange_explicit(&state, LockedWithWaiter, memory_order_acquire) != Unlocked) {
// TODO: As the critical section is brief, it is a better choice to spin a few times befor sleeping.
- __futex_wait_ex(&state, process_shared, LockedWithWaiter, NULL);
+ __futex_wait_ex(&state, process_shared, LockedWithWaiter, false, nullptr);
}
return;
}