10#include <boost/asio.hpp>
11#include <boost/any.hpp>
12#include <boost/thread/thread.hpp>
19typedef boost::asio::executor_work_guard<io_context_t::executor_type>
work_t;
37 template <
typename TYPE>
40 while (
value.empty()) {
43 return value.empty() ? TYPE() : boost::any_cast<TYPE>(
value);
66 template <
typename FUNC>
75 template <
typename FUNC>
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
A Future represents the result of an asynchronous computation. Methods are provided to check if the c...
Definition ThreadPool.h:24
boost::any value
Definition ThreadPool.h:29
TYPE get()
Definition ThreadPool.h:38
void set(const boost::any &value)
Definition ThreadPool.h:32
virtual void wait(int32_t timeout=0)
Wait for signal using an optional timeout.
Utility class to support scope locking.
Definition Synchronize.h:46
FuturePtr scheduleTask(FUNC func)
Definition ThreadPool.h:67
boost::thread_group threadGroup
Definition ThreadPool.h:58
void execute(FUNC func, const FuturePtr &future)
Definition ThreadPool.h:76
static ThreadPoolPtr getInstance()
Get singleton thread pool instance.
work_t work
Definition ThreadPool.h:57
io_context_t io_context
Definition ThreadPool.h:56
static const int32_t THREADPOOL_SIZE
Definition ThreadPool.h:60
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< ThreadPool > ThreadPoolPtr
Definition LuceneTypes.h:553
boost::shared_ptr< T > newInstance()
Definition LuceneFactory.h:16
boost::asio::executor_work_guard< io_context_t::executor_type > work_t
Definition ThreadPool.h:19
boost::asio::io_context io_context_t
Definition ThreadPool.h:18
boost::shared_ptr< Future > FuturePtr
Definition LuceneTypes.h:530