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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
Lucene::LuceneThread Class Referenceabstract

Lucene thread container. More...

`#include <LuceneThread.h>`

Inheritance diagram for Lucene::LuceneThread:

## Public Member Functions

| LuceneThread ()
virtual | ~LuceneThread ()
virtual String | getClassName ()
boost::shared_ptr< LuceneThread > | shared_from_this ()
virtual void | start ()
| start thread see run. More...
virtual bool | isAlive ()
| return whether thread is current running. More...
virtual void | setPriority (int32_t priority)
| set running thread priority. More...
virtual int32_t | getPriority ()
| return running thread priority. More...
virtual bool | join (int32_t timeout=0)
| wait for thread to finish using an optional timeout. More...
virtual void | yield ()
| causes the currently executing thread object to temporarily pause and allow other threads to execute. More...
virtual void | run ()=0
| override to provide the body of the thread. More...
Public Member Functions inherited from Lucene::LuceneObject
virtual | ~LuceneObject ()
virtual void | initialize ()
| Called directly after instantiation to create objects that depend on this object being fully constructed. More...
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (LuceneObjectPtr other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (LuceneObjectPtr other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Static Public Member Functions

static String | _getClassName ()
static int64_t | currentId ()
| Return representation of current execution thread. More...
static void | threadSleep (int32_t time)
| Suspends current execution thread for a given time. More...
static void | threadYield ()
| Yield current execution thread. More...

## Static Public Attributes

static const int32_t | MAX_PRIORITY
static const int32_t | NORM_PRIORITY
static const int32_t | MIN_PRIORITY

## Protected Member Functions

void | setRunning (bool running)
| set thread running state. More...
bool | isRunning ()
| return thread running state. More...
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Static Protected Member Functions

static void | runThread (LuceneThread *thread)
| function that controls the lifetime of the running thread. More...

## Protected Attributes

threadPtr | thread
bool | running
| Flag to indicate running thread. More...

## Detailed Description

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.

## Constructor & Destructor Documentation

Lucene::LuceneThread::LuceneThread | ( | ) |  |

virtual Lucene::LuceneThread::~LuceneThread | ( | ) |  |

virtual

## Member Function Documentation

static String Lucene::LuceneThread::_getClassName | ( | ) |  |

inline static

static int64_t Lucene::LuceneThread::currentId | ( | ) |  |

static

Return representation of current execution thread.

Referenced by Lucene::CloseableThreadLocal< Lucene::IndexInput >::close(), Lucene::CloseableThreadLocal< Lucene::IndexInput >::get(), and Lucene::CloseableThreadLocal< Lucene::IndexInput >::set().

virtual String Lucene::LuceneThread::getClassName | ( | ) |  |

inline virtual

virtual int32_t Lucene::LuceneThread::getPriority | ( | ) |  |

virtual

return running thread priority.

virtual bool Lucene::LuceneThread::isAlive | ( | ) |  |

virtual

return whether thread is current running.

bool Lucene::LuceneThread::isRunning | ( | ) |  |

protected

return thread running state.

virtual bool Lucene::LuceneThread::join | ( | int32_t | timeout = `0`) |  |

virtual

wait for thread to finish using an optional timeout.

virtual void Lucene::LuceneThread::run | ( | ) |  |

pure virtual

override to provide the body of the thread.

static void Lucene::LuceneThread::runThread | ( | LuceneThread * | thread) |  |

static protected

function that controls the lifetime of the running thread.

virtual void Lucene::LuceneThread::setPriority | ( | int32_t | priority) |  |

virtual

set running thread priority.

void Lucene::LuceneThread::setRunning | ( | bool | running) |  |

protected

set thread running state.

boost::shared_ptr< LuceneThread > Lucene::LuceneThread::shared_from_this | ( | ) |  |

inline

virtual void Lucene::LuceneThread::start | ( | ) |  |

virtual

start thread see run.

static void Lucene::LuceneThread::threadSleep | ( | int32_t | time) |  |

static

Suspends current execution thread for a given time.

static void Lucene::LuceneThread::threadYield | ( | ) |  |

static

Yield current execution thread.

virtual void Lucene::LuceneThread::yield | ( | ) |  |

virtual

causes the currently executing thread object to temporarily pause and allow other threads to execute.

## Field Documentation

const int32_t Lucene::LuceneThread::MAX_PRIORITY

static

const int32_t Lucene::LuceneThread::MIN_PRIORITY

static

const int32_t Lucene::LuceneThread::NORM_PRIORITY

static

bool Lucene::LuceneThread::running

protected

Flag to indicate running thread.

See Also
  isAlive

threadPtr Lucene::LuceneThread::thread

protected

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

- LuceneThread.h

clucene.sourceforge.net