Multithreaded Programming Guide

Exit Print View

Updated: July 2014
 
 

Using Mutual Exclusion Locks

Table 4–3 lists the functions that manipulate mutex locks.

Table 4-3  Routines for Mutual Exclusion Locks
Operation
Related Function Description
Initialize a mutex
Make mutex consistent
Lock a mutex
Unlock a mutex
Lock with a nonblocking mutex
Lock a mutex before a specified time
Lock a mutex within a specified time interval
Destroy a mutex

The default scheduling policy, SCHED_OTHER, does not specify the order in which threads can acquire a lock. When multiple SCHED_OTHER threads are waiting for a mutex, the order of acquisition is undefined. Under the SCHED_FIFO and SCHED_RR real-time scheduling policies, the behavior is to unblock waiting threads in priority order.