![]() |
Fabcoin Core
0.16.2
P2P Digital Currency
|
#include <mutex>#include <condition_variable>#include <atomic>#include <boost/thread.hpp>Go to the source code of this file.
Classes | |
| struct | dev::GenericGuardBool< GuardType, MutexType > |
| struct | dev::GenericUnguardBool< MutexType > |
| struct | dev::GenericUnguardSharedBool< MutexType > |
| class | dev::SpinLock |
| Simple lock that waits for release without making context switch. More... | |
| class | dev::Notified< N > |
Namespaces | |
| dev | |
| Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Originally by René Nyffenegger. | |
Macros | |
| #define | DEV_GUARDED(MUTEX) for (GenericGuardBool<Guard, Mutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
| Simple block guard. More... | |
| #define | DEV_READ_GUARDED(MUTEX) for (GenericGuardBool<ReadGuard, SharedMutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
| #define | DEV_WRITE_GUARDED(MUTEX) for (GenericGuardBool<WriteGuard, SharedMutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
| #define | DEV_RECURSIVE_GUARDED(MUTEX) for (GenericGuardBool<RecursiveGuard, RecursiveMutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
| #define | DEV_UNGUARDED(MUTEX) for (GenericUnguardBool<Mutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
| #define | DEV_READ_UNGUARDED(MUTEX) for (GenericUnguardSharedBool<SharedMutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
| #define | DEV_WRITE_UNGUARDED(MUTEX) for (GenericUnguardBool<SharedMutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
Typedefs | |
| using | dev::Mutex = std::mutex |
| using | dev::RecursiveMutex = std::recursive_mutex |
| using | dev::SharedMutex = boost::shared_mutex |
| using | dev::Guard = std::lock_guard< std::mutex > |
| using | dev::UniqueGuard = std::unique_lock< std::mutex > |
| using | dev::RecursiveGuard = std::lock_guard< std::recursive_mutex > |
| using | dev::ReadGuard = boost::shared_lock< boost::shared_mutex > |
| using | dev::UpgradableGuard = boost::upgrade_lock< boost::shared_mutex > |
| using | dev::UpgradeGuard = boost::upgrade_to_unique_lock< boost::shared_mutex > |
| using | dev::WriteGuard = boost::unique_lock< boost::shared_mutex > |
| using | dev::SpinGuard = std::lock_guard< SpinLock > |
Definition in file Guards.h.
| #define DEV_GUARDED | ( | MUTEX | ) | for (GenericGuardBool<Guard, Mutex> __eth_l(MUTEX); __eth_l.b; __eth_l.b = false) |
Simple block guard.
The expression/block following is guarded though the given mutex. Usage:
There are several variants of this basic mechanism for different Mutex types and Guards.
There is also the UNGUARD variant which allows an unguarded expression/block to exist within a guarded expression. eg:
1.8.11