P99

◆ mtx_type

enum mtx_type

C11 mutex types.

Enumerator
mtx_plain 

passed to ::mtx_init to create a mutex object that supports neither timeout nor test and return

mtx_recursive 

passed to ::mtx_init to create a mutex object that supports recursive locking

mtx_timed 

passed to ::mtx_init to create a mutex object that supports timeout

In this implementation this feature is always provided.

mtx_normal 

passed to ::mtx_init to create a mutex object that deadlocks when locked twice

Consider a deadlock as a feature, here. Without this locking a mutex again is just undefined behavior, so anything could happen.

Remarks
This is an extension that comes with POSIX. Don't use it if you want your code to be portable outside POSIX.
mtx_errorcheck 

passed to ::mtx_init to create a mutex object that returns an error when locked twice

Remarks
This is an extension that comes with POSIX. Don't use it if you want your code to be portable outside POSIX.
mtx_extras 

used internally

This is meant to accumulate all extra flags that could be distinguished with POSIX mutex. This is not a valid flag to pass to ::mtx_init.

Definition at line 152 of file p99_threads_posix.h.