hpx::unlock_guard
hpx::unlock_guard#
Defined in header hpx/mutex.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace hpx
-
template<typename Mutex>
class unlock_guard# - #include <unlock_guard.hpp>
The class
unlock_guard
is a mutex wrapper that provides a convenient mechanism for releasing a mutex for the duration of a scoped block.unlock_guard
performs the opposite functionality oflock_guard
. When alock_guard
object is created, it attempts to take ownership of the mutex it is given. When control leaves the scope in which thelock_guard
object was created, thelock_guard
is destructed and the mutex is released. Accordingly, when anunlock_guard
object is created, it attempts to release the ownership of the mutex it is given. So, when control leaves the scope in which theunlock_guard
object was created, theunlock_guard
is destructed and the mutex is owned again. In this way, the mutex is unlocked in the constructor and locked in the destructor, so that one can have an unlocked section within a locked one.
-
namespace util
Typedefs
-
using instead = hpx::unlock_guard<Mutex>
-
using instead = hpx::unlock_guard<Mutex>
-
template<typename Mutex>