libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
|
Lock the cache for writing. Implements RAII for the multi-process write lock for the cache. More...
#include <mp_lock_guard.h>
Public Types | |
enum class | operation { read , write } |
Public Member Functions | |
mp_lock_guard ()=delete | |
mp_lock_guard (const mp_lock_guard &)=delete | |
mp_lock_guard (int fd, operation op, const mp_lock_guard_logger &logger=mp_lock_guard_logger_default()) | |
Lock the cache for reading or writing. These are blocking locks. | |
mp_lock_guard & | operator= (const mp_lock_guard &)=delete |
void | release () |
~mp_lock_guard () | |
Unlock the cache. Works for both read and write locks. | |
Static Public Member Functions | |
static void | unlock (int fd, const mp_lock_guard_logger &logger=mp_lock_guard_logger_default()) |
Friends | |
class | mp_lock_guard_test |
Lock the cache for writing. Implements RAII for the multi-process write lock for the cache.
This class has an extra method that enables the client to 'release' the lock so that it wil NOT be released when the guard goes out of scope.
Definition at line 79 of file mp_lock_guard.h.
|
strong |
Enumerator | |
---|---|
read | |
write |
Definition at line 81 of file mp_lock_guard.h.
|
delete |
|
delete |
|
inline |
Lock the cache for reading or writing. These are blocking locks.
fd | The file descriptor of the cache control file. |
op | The operation to perform. If op is 'write' then the lock is a write lock; if op is 'read' then the lock is a read lock. |
Definition at line 130 of file mp_lock_guard.h.
|
inline |
Unlock the cache. Works for both read and write locks.
Definition at line 142 of file mp_lock_guard.h.
|
delete |
|
inline |
Release control of the lock so that control can exit scope and the lock can be released somewhere else.
Definition at line 160 of file mp_lock_guard.h.
|
inlinestatic |
Unlock the cache.
Definition at line 165 of file mp_lock_guard.h.
|
friend |
Definition at line 115 of file mp_lock_guard.h.