CLucene - a full-featured, c++ search engine
API Documentation


lucene::store::LuceneLock Class Reference

#include <Lock.h>


Public Member Functions

 LUCENE_STATIC_CONSTANT (int64_t, LOCK_POLL_INTERVAL=1000)
 LUCENE_STATIC_CONSTANT (int64_t, LOCK_OBTAIN_WAIT_FOREVER=-1)
virtual bool obtain ()=0
 Attempts to obtain exclusive access and immediately return upon success or failure.
bool obtain (int64_t lockWaitTimeout)
 Attempts to obtain an exclusive lock within amount of time given.
virtual void release ()=0
virtual bool isLocked ()=0
 Returns true if the resource is currently locked.
virtual ~LuceneLock ()
virtual TCHAR * toString ()=0


Constructor & Destructor Documentation

virtual lucene::store::LuceneLock::~LuceneLock (  )  [virtual]


Member Function Documentation

lucene::store::LuceneLock::LUCENE_STATIC_CONSTANT ( int64_t  ,
LOCK_POLL_INTERVAL  = 1000 
)

lucene::store::LuceneLock::LUCENE_STATIC_CONSTANT ( int64_t  ,
LOCK_OBTAIN_WAIT_FOREVER  = -1 
)

virtual bool lucene::store::LuceneLock::obtain (  )  [pure virtual]

Attempts to obtain exclusive access and immediately return upon success or failure.

Returns:
true iff exclusive access is obtained

bool lucene::store::LuceneLock::obtain ( int64_t  lockWaitTimeout  ) 

Attempts to obtain an exclusive lock within amount of time given.

Currently polls once per second until lockWaitTimeout is passed.

Parameters:
lockWaitTimeout length of time to wait in ms
Returns:
true if lock was obtained
Exceptions:
IOException if lock wait times out or obtain() throws an IOException

virtual void lucene::store::LuceneLock::release (  )  [pure virtual]

virtual bool lucene::store::LuceneLock::isLocked (  )  [pure virtual]

Returns true if the resource is currently locked.

Note that one must still call obtain() before using the resource.

virtual TCHAR* lucene::store::LuceneLock::toString (  )  [pure virtual]


The documentation for this class was generated from the following file:

clucene.sourceforge.net