Lucene++ - a full-featured, c++ search engine
API Documentation
Lucene thread container. More...
#include <LuceneThread.h>
Public Member Functions | |
LuceneThread () | |
virtual | ~LuceneThread () |
virtual String | getClassName () |
boost::shared_ptr< LuceneThread > | shared_from_this () |
virtual void | start () |
start thread see run . | |
virtual bool | isAlive () |
return whether thread is current running. | |
virtual void | setPriority (int32_t priority) |
set running thread priority. | |
virtual int32_t | getPriority () |
return running thread priority. | |
virtual bool | join (int32_t timeout=0) |
wait for thread to finish using an optional timeout. | |
virtual void | yield () |
causes the currently executing thread object to temporarily pause and allow other threads to execute. | |
virtual void | run ()=0 |
override to provide the body of the thread. | |
![]() | |
virtual | ~LuceneObject () |
virtual void | initialize () |
Called directly after instantiation to create objects that depend on this object being fully constructed. | |
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Return clone of this object. | |
virtual int32_t | hashCode () |
Return hash code for this object. | |
virtual bool | equals (const LuceneObjectPtr &other) |
Return whether two objects are equal. | |
virtual int32_t | compareTo (const LuceneObjectPtr &other) |
Compare two objects. | |
virtual String | toString () |
Returns a string representation of the object. | |
![]() | |
virtual | ~LuceneSync () |
virtual SynchronizePtr | getSync () |
Return this object synchronize lock. | |
virtual LuceneSignalPtr | getSignal () |
Return this object signal. | |
virtual void | lock (int32_t timeout=0) |
Lock this object using an optional timeout. | |
virtual void | unlock () |
Unlock this object. | |
virtual bool | holdsLock () |
Returns true if this object is currently locked by current thread. | |
virtual void | wait (int32_t timeout=0) |
Wait for signal using an optional timeout. | |
virtual void | notifyAll () |
Notify all threads waiting for signal. | |
Static Public Member Functions | |
static String | _getClassName () |
static int64_t | currentId () |
Return representation of current execution thread. | |
static void | threadSleep (int32_t time) |
Suspends current execution thread for a given time. | |
static void | threadYield () |
Yield current execution thread. | |
Static Public Attributes | |
static const int32_t | MAX_THREAD_PRIORITY |
static const int32_t | NORM_THREAD_PRIORITY |
static const int32_t | MIN_THREAD_PRIORITY |
Protected Member Functions | |
void | setRunning (bool running) |
set thread running state. | |
bool | isRunning () |
return thread running state. | |
![]() | |
LuceneObject () | |
Static Protected Member Functions | |
static void | runThread (LuceneThread *thread) |
function that controls the lifetime of the running thread. | |
Protected Attributes | |
threadPtr | thread |
bool | running |
Flag to indicate running thread. | |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Lucene thread container.
It seems there are major issues with using boost::thread::id under Windows. After many hours of debugging and trying various strategies, I was unable to fix an occasional crash whereby boost::thread::thread_data was being deleted prematurely.
This problem is most visible when running the AtomicUpdateTest test suite.
Therefore, I now uniquely identify threads by their native id.
Lucene::LuceneThread::LuceneThread | ( | ) |
|
virtual |
|
inlinestatic |
|
static |
Return representation of current execution thread.
Referenced by Lucene::CloseableThreadLocal< TYPE >::close(), Lucene::CloseableThreadLocal< TYPE >::get(), and Lucene::CloseableThreadLocal< TYPE >::set().
|
inlinevirtual |
|
virtual |
return running thread priority.
|
virtual |
return whether thread is current running.
|
protected |
return thread running state.
|
virtual |
wait for thread to finish using an optional timeout.
|
pure virtual |
override to provide the body of the thread.
|
staticprotected |
function that controls the lifetime of the running thread.
|
virtual |
set running thread priority.
|
protected |
set thread running state.
|
inline |
|
virtual |
start thread see run
.
|
static |
Suspends current execution thread for a given time.
|
static |
Yield current execution thread.
|
virtual |
causes the currently executing thread object to temporarily pause and allow other threads to execute.
|
static |
|
static |
|
static |
|
protected |
Flag to indicate running thread.
|
protected |