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

Loading...
Searching...
No Matches
LuceneSignal.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef LUCENESIGNAL_H
8#define LUCENESIGNAL_H
9
10#include <boost/thread/condition.hpp>
11#include "Lucene.h"
12
13 namespace Lucene {
14
16 class LPPAPI LuceneSignal {
17 public:
18 LuceneSignal(const SynchronizePtr& objectLock = SynchronizePtr());
19 virtual ~LuceneSignal();
20
21 protected:
22 boost::mutex waitMutex;
23 boost::condition signalCondition;
24 SynchronizePtr objectLock;
25
26 public:
28 static void createSignal(LuceneSignalPtr& signal, const SynchronizePtr& objectLock);
29
31 void wait(int32_t timeout = 0);
32
34 void notifyAll();
35};
36
37}
38
39#endif
Lucene::LuceneSignal
Utility class to support signaling notifications.
Definition LuceneSignal.h:16
Lucene::LuceneSignal::LuceneSignal
LuceneSignal(const SynchronizePtr &objectLock=SynchronizePtr())
Lucene::LuceneSignal::waitMutex
boost::mutex waitMutex
Definition LuceneSignal.h:22
Lucene::LuceneSignal::objectLock
SynchronizePtr objectLock
Definition LuceneSignal.h:24
Lucene::LuceneSignal::notifyAll
void notifyAll()
Notify all threads waiting for signal.
Lucene::LuceneSignal::~LuceneSignal
virtual ~LuceneSignal()
Lucene::LuceneSignal::signalCondition
boost::condition signalCondition
Definition LuceneSignal.h:23
Lucene::LuceneSignal::wait
void wait(int32_t timeout=0)
Wait for signal using an optional timeout.
Lucene::LuceneSignal::createSignal
static void createSignal(LuceneSignalPtr &signal, const SynchronizePtr &objectLock)
create a new LuceneSignal instance atomically.
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::SynchronizePtr
boost::shared_ptr< Synchronize > SynchronizePtr
Definition LuceneTypes.h:552
Lucene::LuceneSignalPtr
boost::shared_ptr< LuceneSignal > LuceneSignalPtr
Definition LuceneTypes.h:540

clucene.sourceforge.net