All the lock types have the following types of management functions:
Allocation functions that allocate resources and acquire the lock.
Initialization functions that initialize the variable as part of a programmer-defined structure to reduce allocation overhead for the lock.
Deinitialization functions that reset the variable to its unused value.
For some lock types, the following types of management functions are available:
Owning functions that allow a calling thread to determine whether it is the owner of a lock. This is useful because none of the locks are guaranteed to behave recursively.
Try functions that attempt to acquire a lock. (They do not block if the lock cannot be acquired but return a value to that effect.) These functions can help you avoid deadlock.
Time-out functions that associate a wait period with acquiring the lock. If the lock cannot be acquired before the timer expires, the function returns an error.
Try functions and time-out periods should be used sparingly and not as a remedy for bad lock design.