21 #ifndef XAPIAN_INCLUDED_FLINT_LOCK_H
22 #define XAPIAN_INCLUDED_FLINT_LOCK_H
25 # error config.h must be included first in each C++ source file
30 #if defined __CYGWIN__ || defined __WIN32__
33 # include <sys/types.h>
38 #if defined __CYGWIN__ || defined __WIN32__
39 HANDLE hFile = INVALID_HANDLE_VALUE;
40 #elif defined FLINTLOCK_USE_FLOCK
68 operator bool()
const {
69 #if defined __CYGWIN__ || defined __WIN32__
70 return hFile != INVALID_HANDLE_VALUE;
101 reason lock(
bool exclusive,
bool wait, std::string & explanation);
109 const std::string & db_dir,
110 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.
include <windows.h> without all the bloat and damage.