futex_wait - Wait on a futex.
#include <magenta/syscalls.h>
mx_status_t mx_futex_wait(int* value_ptr, int current_value,
mx_time_t timeout);
Waiting on a futex (or acquiring it) causes a thread to sleep until
the futex is made available by a call to mx_futex_wake
. Optionally,
the thread can also be woken up after the timeout argument expires.
futex_wait() returns NO_ERROR on success.
ERR_INVALID_ARGS value_ptr is not a valid userspace pointer.
ERR_BUSY current_value does not match the value at value_ptr.
ERR_TIMED_OUT The thread was not woken before timeout expired.