MultiLockableReference references multiple lockables.
More...
#include <LockableReference.hpp>
|
using | Lockable = LockableT |
|
|
template<typename InputIterator > |
| MultiLockableReference (std::weak_ptr< const void > lockableHolder, InputIterator first, InputIterator last) |
| Constructs from multiple lockables. More...
|
|
void | lock () override |
| Locks lockable that this class references; blocks if one of the lockables are not avaliable. More...
|
|
bool | try_lock () noexcept override |
| Tries to lock the lockables that this class references; returns false if one of the lockables is not avaliable. More...
|
|
void | unlock () noexcept override |
| Unlocks the lockables.
|
|
constexpr | LockableReference () noexcept=default |
| Default construtor.
|
|
virtual | ~LockableReference ()=default |
| Default destructor.
|
|
template<typename LockableT>
class dart::common::MultiLockableReference< LockableT >
MultiLockableReference references multiple lockables.
MultiLockableReference acquires the locks in the specified order, which means it is the user's responsibility to sort the collection to avoid deadlock.
- Template Parameters
-
LockableT | The standard C++ Lockable concept object type. |
◆ MultiLockableReference()
template<typename Lockable >
template<typename InputIterator >
Constructs from multiple lockables.
- Parameters
-
[in] | lockableHolder | Weak pointer to an object that holds the lockables. This is used to lock/unlock this lockable only when the lockable holder is not destructed. |
[in] | first | First iterator of lockable to be added to this class. |
[in] | last | Last iterator of lockable to be added to this class. |
◆ lock()
template<typename Lockable >
◆ try_lock()
template<typename Lockable >
Tries to lock the lockables that this class references; returns false if one of the lockables is not avaliable.
Implements dart::common::LockableReference.
The documentation for this class was generated from the following files: