Template class for making a pointer to some data that that needs protection by a mutex. When the Ptr goes out of scope or is deleted the mutex is automatically released.
More...
#include <mutex.h>
List of all members.
Detailed Description
template<class T>
class CxUtils::Mutex::ScopedPtr< T >
Template class for making a pointer to some data that that needs protection by a mutex. When the Ptr goes out of scope or is deleted the mutex is automatically released.
If the provided mutex is already locked, the scoped ptr will not double lock, and will also not perform an unlock on release. However, if on creation the forceUnlock flag is true, the pointer will always unlock regardless.
Definition at line 92 of file mutex.h.
Constructor & Destructor Documentation
Constructor for creation of a ScopedPtr.
- Parameters:
-
[in] | data | Pointer to data to be protected by a mutex until program exits the scope this structure was created in. |
[in] | mutex | Pointer to the mutex to use within the current program scope. |
[in] | forceUnlock | If true (default is false) then when the object goes out of scope, the mutex is unlocked always. |
Definition at line 106 of file mutex.h.
Member Function Documentation
The documentation for this class was generated from the following file:
- C:/Active/libraries/cxutils/2.0/include/cxutils/mutex.h