DASH
0.3.0
|
Synchronization primitives for mutual exclusion of units. More...
![]() |
Typedefs | |
typedef struct dart_lock_struct * | dart_lock_t |
Lock type to ensure mutual exclusion among units in a team. More... | |
Functions | |
dart_ret_t | dart_team_lock_init (dart_team_t teamid, dart_lock_t *lock) |
Collective operation to initialize the lock object. More... | |
dart_ret_t | dart_team_lock_destroy (dart_lock_t *lock) |
Collective operation to destroy a lock initialized using dart_team_lock_init. More... | |
dart_ret_t | dart_lock_acquire (dart_lock_t lock) |
Block until the lock was acquired. More... | |
dart_ret_t | dart_lock_try_acquire (dart_lock_t lock, int32_t *result) |
Try to acquire the lock and return immediately. More... | |
dart_ret_t | dart_lock_release (dart_lock_t lock) |
Release the lock acquired through dart_lock_acquire or dart_lock_try_acquire. More... | |
Synchronization primitives for mutual exclusion of units.
typedef struct dart_lock_struct* dart_lock_t |
#include </tmp/tmporruphar/dart-if/include/dash/dart/if/dart_synchronization.h>
Lock type to ensure mutual exclusion among units in a team.
The lock is thread-aware so only one thread of a unit can acquire the lock at once.
Definition at line 30 of file dart_synchronization.h.
dart_ret_t dart_lock_acquire | ( | dart_lock_t | lock | ) |
#include </tmp/tmporruphar/dart-if/include/dash/dart/if/dart_synchronization.h>
Block until the lock
was acquired.
The lock can be held by any thread in any unit of the team.
Note that the lock is not recursive, trying to acquire the lock twice in the same thread is erroneous.
lock | The lock to acquire |
DART_OK
on sucess or an error code from dart_ret_t otherwise.dart_ret_t dart_lock_release | ( | dart_lock_t | lock | ) |
#include </tmp/tmporruphar/dart-if/include/dash/dart/if/dart_synchronization.h>
Release the lock acquired through dart_lock_acquire or dart_lock_try_acquire.
lock | The lock to release. |
DART_OK
on sucess or an error code from dart_ret_t otherwise.dart_ret_t dart_lock_try_acquire | ( | dart_lock_t | lock, |
int32_t * | result | ||
) |
#include </tmp/tmporruphar/dart-if/include/dash/dart/if/dart_synchronization.h>
Try to acquire the lock and return immediately.
Note that the lock is not recursive, trying to acquire the lock twice in the same thread is erroneous.
lock | The lock to acquire | |
[out] | result | True if the lock was successfully acquired, false otherwise. |
DART_OK
on success or an error code from dart_ret_t otherwise.dart_ret_t dart_team_lock_destroy | ( | dart_lock_t * | lock | ) |
#include </tmp/tmporruphar/dart-if/include/dash/dart/if/dart_synchronization.h>
Collective operation to destroy a lock
initialized using dart_team_lock_init.
lock | The lock to free. |
DART_OK
on sucess or an error code from dart_ret_t otherwise.dart_ret_t dart_team_lock_init | ( | dart_team_t | teamid, |
dart_lock_t * | lock | ||
) |
#include </tmp/tmporruphar/dart-if/include/dash/dart/if/dart_synchronization.h>
Collective operation to initialize the lock
object.
teamid | Team this lock is used for. |
lock | The lock to initialize. |
DART_OK
on sucess or an error code from dart_ret_t otherwise.