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

Loading...
Searching...
No Matches
Data Structures | Namespaces | Macros
Synchronize.h File Reference
`#include <atomic>`
`#include <boost/thread/recursive_mutex.hpp>`
`#include <boost/thread/mutex.hpp>`
`#include "Lucene.h"`

Go to the source code of this file.

## Data Structures

class | Lucene::Synchronize
| Utility class to support locking via a mutex. More...
class | Lucene::SyncLock
| Utility class to support scope locking. More...

## Namespaces

namespace | Lucene

## Macros

#define | LUCENE_RUN_ONCE(Command)

## Macro Definition Documentation

## ◆ LUCENE_RUN_ONCE

#define LUCENE_RUN_ONCE | ( |  | Command | ) |

Value:
do { \
static std::atomic<bool> RUN_ONCE_hasRun = {}; \
if (!RUN_ONCE_hasRun) { \
static boost::mutex RUN_ONCE_mutex; \
boost::mutex::scoped_lock RUN_ONCE_lock(RUN_ONCE_mutex); \
if (!RUN_ONCE_hasRun) { \
Command; \
RUN_ONCE_hasRun = true; \
} \
} \
} while(0)

clucene.sourceforge.net