Storage Engine API
mongo::CommitNotifier Class Reference

Establishes a synchronization point between threads. More...

#include <commit_notifier.h>

Detailed Description

Establishes a synchronization point between threads.

N threads are waits and one is notifier.

Public Types

typedef unsigned long long When
 

Public Member Functions

 CommitNotifier ()
 
 ~CommitNotifier ()
 
When now ()
 
void waitFor (When e)
 Awaits the next notifyAll() call by another thread. More...
 
void awaitBeyondNow ()
 A bit faster than waitFor(now()). More...
 
void notifyAll (When e)
 May be called multiple times. More...
 
unsigned nWaiting () const
 Returns how many threads are blocked in the waitFor/awaitBeyondNow calls. More...
 

Private Member Functions

 MONGO_DISALLOW_COPYING (CommitNotifier)
 

Private Attributes

stdx::mutex _mutex
 
stdx::condition_variable _condition
 
When _lastDone {0}
 
When _lastReturned {0}
 
unsigned _nWaiting {0}
 

Member Typedef Documentation

◆ When

typedef unsigned long long mongo::CommitNotifier::When

Constructor & Destructor Documentation

◆ CommitNotifier()

mongo::CommitNotifier::CommitNotifier ( )
default

◆ ~CommitNotifier()

mongo::CommitNotifier::~CommitNotifier ( )

Member Function Documentation

◆ awaitBeyondNow()

void mongo::CommitNotifier::awaitBeyondNow ( )

A bit faster than waitFor(now()).

◆ MONGO_DISALLOW_COPYING()

mongo::CommitNotifier::MONGO_DISALLOW_COPYING ( CommitNotifier  )
private

◆ notifyAll()

void mongo::CommitNotifier::notifyAll ( When  e)

May be called multiple times.

Notifies all waiters.

◆ now()

CommitNotifier::When mongo::CommitNotifier::now ( )

◆ nWaiting()

unsigned mongo::CommitNotifier::nWaiting ( ) const
inline

Returns how many threads are blocked in the waitFor/awaitBeyondNow calls.

◆ waitFor()

void mongo::CommitNotifier::waitFor ( When  e)

Awaits the next notifyAll() call by another thread.

notifications that precede this call are ignored – we are looking for a fresh event.

Member Data Documentation

◆ _condition

stdx::condition_variable mongo::CommitNotifier::_condition
private

◆ _lastDone

When mongo::CommitNotifier::_lastDone {0}
private

◆ _lastReturned

When mongo::CommitNotifier::_lastReturned {0}
private

◆ _mutex

stdx::mutex mongo::CommitNotifier::_mutex
private

◆ _nWaiting

unsigned mongo::CommitNotifier::_nWaiting {0}
private

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