libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::Latch Class Reference

This implements a pure C++ Latch providing lock-S (shared) and lock-X (exclusive). More...

#include <ReadWriteLock.h>

Public Member Functions

 Latch ()
 Latch (bool _px)
 Latch (const Latch &)=delete
 Latch (Latch &&)=delete
void lock ()
void lock_shared ()
Latch & operator= (const Latch &)=delete
Latch & operator= (Latch &&)=delete
bool try_lock_shared ()
void unlock ()
void unlock_shared ()
 ~Latch ()

Detailed Description

This implements a pure C++ Latch providing lock-S (shared) and lock-X (exclusive).

The concept used here allows X requests to be prioritized faster and more smoothly than standard implementations. It uses a no-lock strategy whenever possible and reverts to lock and wait in race condition.

Constructor & Destructor Documentation

◆ Latch() [1/4]

osmscout::Latch::Latch ( )

Referenced by Latch(), Latch(), operator=(), and operator=().

◆ Latch() [2/4]

osmscout::Latch::Latch ( bool _px)
inlineexplicit

◆ Latch() [3/4]

osmscout::Latch::Latch ( const Latch & )
delete

References Latch().

◆ Latch() [4/4]

osmscout::Latch::Latch ( Latch && )
delete

References Latch().

◆ ~Latch()

osmscout::Latch::~Latch ( )

Member Function Documentation

◆ lock()

void osmscout::Latch::lock ( )

◆ lock_shared()

void osmscout::Latch::lock_shared ( )

◆ operator=() [1/2]

Latch & osmscout::Latch::operator= ( const Latch & )
delete

References Latch().

◆ operator=() [2/2]

Latch & osmscout::Latch::operator= ( Latch && )
delete

◆ try_lock_shared()

bool osmscout::Latch::try_lock_shared ( )

References osmscout::X_STEP_0.

Referenced by operator=().

◆ unlock()

void osmscout::Latch::unlock ( )

References osmscout::X_STEP_0, and osmscout::X_STEP_2.

Referenced by operator=().

◆ unlock_shared()

void osmscout::Latch::unlock_shared ( )

References osmscout::X_STEP_1, and osmscout::X_STEP_3.

Referenced by operator=().


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