Multithreaded Programming Guide

Exit Print View

Updated: July 2014
 
 

Mutual Exclusion Lock Attributes

Use mutual exclusion locks (mutexes) to serialize thread execution. Mutual exclusion locks synchronize threads, usually by ensuring that only one thread at a time executes a critical section of code. Mutex locks can also preserve single-threaded code.

To change the default mutex attributes, you can declare and initialize an attribute object. Often, the mutex attributes are set in one place at the beginning of the application so the attributes can be located quickly and modified easily. Table 4–1 lists the functions that manipulate mutex attributes.

Table 4-1  Mutex Attributes Routines
Operation
Related Function Description
Initialize a mutex attribute object
Destroy a mutex attribute object
Set the scope of a mutex
Get the scope of a mutex
Set the mutex type attribute
Get the mutex type attribute
Set mutex attribute's protocol
Get mutex attribute's protocol
Set mutex attribute's priority ceiling
Get mutex attribute's priority ceiling
Set mutex's priority ceiling
Get mutex's priority ceiling
Set mutex's robust attribute
Get mutex's robust attribute