Mutex Types and Locking Methods
This lesson discusses different types of mutexes and their locking methods
We'll cover the following...
C++ has five different mutexes that can lock recursively (i.e., multiple layers of locking), tentative with and without time constraints.
Method | mutex | recursive_mutex | timed_mutex | recursive_timed_mutex | shared_timed_mutex |
---|---|---|---|---|---|
m.lock |
yes | yes | yes | yes | yes |
m.unlock |
yes | yes | yes | yes | yes |
m.try_lock |
yes | yes | yes |