22 #ifndef XAPIAN_INCLUDED_FLINT_LOCK_H
23 #define XAPIAN_INCLUDED_FLINT_LOCK_H
26 # error config.h must be included first in each C++ source file
31 #if defined __CYGWIN__ || defined __WIN32__
34 # include <sys/types.h>
41 #if defined __CYGWIN__ || defined __WIN32__
42 HANDLE hFile = INVALID_HANDLE_VALUE;
43 #elif defined FLINTLOCK_USE_FLOCK
71 operator bool()
const {
72 #if defined __CYGWIN__ || defined __WIN32__
73 return hFile != INVALID_HANDLE_VALUE;
104 reason lock(
bool exclusive,
bool wait, std::string & explanation);
112 const std::string & db_dir,
113 const std::string & explanation)
const);
FlintLock()
Constructor for use in read-only cases (like single-file glass).
void release()
Release the lock.
FlintLock(const std::string &filename_)
Standard constructor.
reason lock(bool exclusive, bool wait, std::string &explanation)
Attempt to obtain the lock.
bool test() const
Test if the lock is held.
void throw_databaselockerror(FlintLock::reason why, const std::string &db_dir, const std::string &explanation) const
Throw Xapian::DatabaseLockError.
Define the XAPIAN_NORETURN macro.
include <windows.h> without all the bloat and damage.