1 #ifndef DASH__MUTEX_H__INCLUDED 2 #define DASH__MUTEX_H__INCLUDED 34 struct DestroyDARTLock {
42 "dash::Mutex::operator()",
43 "Failed to destroy DART lock! " 44 "(dart_team_lock_destroy failed)");
100 std::unique_ptr<std::remove_pointer<dart_lock_t>::type, DestroyDARTLock>
106 #endif // DASH__MUTEX_H__INCLUDED bool try_lock()
Try to acquire the lock and return immediately.
This class is a simple memory pool which holds allocates elements of size ValueType.
void lock()
Block until the lock was acquired.
#define DART_LOCK_NULL
Null value for dart_lock_t to reset a DART lock instance.
bool init()
Collective initialization of the DART lock.
~Mutex()=default
Collective destructor to destruct a DART lock.
A Team instance specifies a subset of all available units.
Mutex(Team &team=dash::Team::All())
DASH Mutex is only valid for a dash team.
struct dart_lock_struct * dart_lock_t
Lock type to ensure mutual exclusion among units in a team.
dart_ret_t dart_team_lock_destroy(dart_lock_t *lock)
Collective operation to destroy a lock initialized using dart_team_lock_init.
Behaves similar to std::mutex and is used to ensure mutual exclusion within a dash team...
static Team & All()
The invariant Team instance containing all available units.
void unlock()
Release the lock acquired through lock() or try_lock().