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 61 : filename(filename_) {
65 filename +=
"/flintlock";
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);
116 #endif // XAPIAN_INCLUDED_FLINT_LOCK_H void throw_databaselockerror(FlintLock::reason why, const std::string &db_dir, const std::string &explanation) const
Throw Xapian::DatabaseLockError.
void release()
Release the lock.
Define the XAPIAN_NORETURN macro.
FlintLock()
Constructor for use in read-only cases (like single-file glass).
bool test() const
Test if the lock is held.
include <windows.h> without all the bloat and damage.
FlintLock(const std::string &filename_)
Standard constructor.
reason lock(bool exclusive, bool wait, std::string &explanation)
Attempt to obtain the lock.