mutex
Copyright (C) 2005 IENT-RWTH Aachen
Protects shared data structures from concurrent modifications
Remarks
Prefer the use of a scoped_lock rather than explicitly calling the acquire and release methods.
Groups
Constructors | |
![]() |
Builds an instance of the object |
Multithreading Functions | |
![]() |
Waits until a lock can be acquired |
![]() |
Releases the lock |
![]() |
Returns true if it can immediately acquire a lock, else returns false |
Destructors | |
![]() |
Destroys the object |
Example
int var; typedef gmt::mutex mutex_type; mutex_type mut; inline set_var(int x) { mutex_type::scoped_lock lock(mut); var=x; };
See Also