Automatically locks and unlocks a mutex object. More...
|GenericScopedTryLock (const LockType &lock, bool acquireLockOnInitialisation=true) noexcept|
|Creates a GenericScopedTryLock. More...|
|~GenericScopedTryLock () noexcept|
|bool||isLocked () const noexcept|
|Returns true if the mutex was successfully locked. More...|
|bool||retryLock () const noexcept|
|Retry gaining the lock by calling tryEnter on the underlying lock. More...|
class GenericScopedTryLock< LockType >
Automatically locks and unlocks a mutex object.
Use one of these as a local variable to provide RAII-based locking of a mutex.
Constructor & Destructor Documentation
Creates a GenericScopedTryLock.
If acquireLockOnInitialisation is true then as soon as this ScopedTryLock is created, it will attempt to acquire the lock with tryEnter.
You can retry acquiring the lock by calling retryLock.
When GenericScopedTryLock is deleted, the lock will be released (if the lock was successfully acquired).
Make sure this object is created and deleted by the same thread, otherwise there are no guarantees what will happen! Best just to use it as a local stack object, rather than creating one with the new() operator.
The mutex will be unlocked (if it had been successfully locked) when the destructor is called.
Make sure this object is created and deleted by the same thread, otherwise there are no guarantees what will happen!
Member Function Documentation
Returns true if the mutex was successfully locked.
Retry gaining the lock by calling tryEnter on the underlying lock.
The documentation for this class was generated from the following file:
Generated on Fri Jan 12 2018 09:51:19 for JUCE by 1.8.13