Use mutex_lock(3C) to lock the mutex pointed to by mp. When the mutex is already locked, the calling thread blocks until the mutex becomes available. Blocked threads wait on a prioritized queue. For POSIX threads, see pthread_mutex_lock Syntax.
#include <thread.h> int mutex_lock(mutex_t *mp);
mp points to an illegal address.
The mutex is already locked and is owned by the calling thread.