SLATE 2024.05.31
Software for Linear Algebra Targeting Exascale
|
Constructor acquires lock; destructor releases lock. More...
#include <LockGuard.hh>
Public Member Functions | |
LockGuard (omp_nest_lock_t *lock) | |
Acquire nested lock. | |
~LockGuard () | |
Release nested lock. | |
Constructor acquires lock; destructor releases lock.
This provides safety in case an exception is thrown, which would otherwise by-pass the unlock. Like std::lock_guard, but for OpenMP nested locks.
|
inline |
Acquire nested lock.
[in,out] | lock | OpenMP nested lock. Must be initialized already. |