Multithreaded Programming Guide

Acquire a Mutex

mutex_lock(3T)

#include <thread.h>

int mutex_lock(mutex_t *mp);

Use mutex_lock(3T) 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(3T)".)