See Public API for a list of names and headers that are part of the public HPX API.
- #include <unlock_guard.hpp>
unlock_guardis a mutex wrapper that provides a convenient mechanism for releasing a mutex for the duration of a scoped block.
unlock_guardperforms the opposite functionality of
lock_guard. When a
lock_guardobject is created, it attempts to take ownership of the mutex it is given. When control leaves the scope in which the
lock_guardobject was created, the
lock_guardis destructed and the mutex is released. Accordingly, when an
unlock_guardobject is created, it attempts to release the ownership of the mutex it is given. So, when control leaves the scope in which the
unlock_guardobject was created, the
unlock_guardis destructed and the mutex is owned again. In this way, the mutex is unlocked in the constructor and locked in the desctuctor, so that one can have an unlocked section within a locked one.
- inline ~unlock_guard()#
- template<typename Mutex>