Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
#include "threadsafety.h"
#include <boost/thread/condition_variable.hpp>
#include <boost/thread/locks.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
Go to the source code of this file.
Classes | |
class | AnnotatedMixin< PARENT > |
class | CMutexLock< Mutex > |
Wrapper around boost::unique_lock<Mutex> More... | |
class | CSemaphore |
class | CSemaphoreGrant |
RAII-style semaphore lock. More... | |
Macros | |
#define | AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs) |
#define | LOCK(cs) CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__) |
#define | LOCK2(cs1, cs2) CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__),criticalblock2(cs2, #cs2, __FILE__, __LINE__) |
#define | TRY_LOCK(cs, name) CCriticalBlock name(cs, #cs, __FILE__, __LINE__, true) |
#define | ENTER_CRITICAL_SECTION(cs) |
#define | LEAVE_CRITICAL_SECTION(cs) |
Typedefs | |
typedef AnnotatedMixin< boost::recursive_mutex > | CCriticalSection |
Wrapped boost mutex: supports recursive locking, but no waiting. More... | |
typedef AnnotatedMixin< boost::mutex > | CWaitableCriticalSection |
Wrapped boost mutex: supports waiting but not recursive locking. More... | |
typedef CMutexLock< CCriticalSection > | CCriticalBlock |
Functions | |
static void | EnterCritical (const char *pszName, const char *pszFile, int nLine, void *cs, bool fTry=false) |
static void | LeaveCritical () |
static void | AssertLockHeldInternal (const char *pszName, const char *pszFile, int nLine, void *cs) |
#define AssertLockHeld | ( | cs | ) | AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs) |
Definition at line 97 of file sync.h.
Referenced by AcceptBlock(), AcceptToMemoryPool(), CWallet::AddKeyPubKey(), CWallet::AddToWalletIfInvolvingMe(), CWallet::CanSupportFeature(), CheckForkWarningConditions(), CheckForkWarningConditionsOnNewFork(), ConnectBlock(), TransactionDesc::FormatTxStatus(), CWallet::GenerateNewKey(), CWallet::GetAccountAddresses(), CWallet::GetAddressGroupings(), CWallet::GetConflicts(), CMerkleTx::GetDepthInMainChain(), CMerkleTx::GetDepthInMainChainINTERNAL(), CWallet::GetKeyBirthTimes(), CWallet::GetKeyPoolSize(), CBlockIndex::GetMedianTime(), CWallet::IncOrderPosNext(), IsFinalTx(), CWallet::IsLockedCoin(), IsStandardTx(), CWallet::ListLockedCoins(), CWallet::LoadKeyMetadata(), CWallet::LoadMinVersion(), CWallet::LockCoin(), CWallet::OrderedTxItems(), PrintBlockTree(), ProcessBlock(), PushGetBlocks(), TransactionRecord::statusUpdateNeeded(), CWallet::UnlockAllCoins(), CWallet::UnlockCoin(), and TransactionRecord::updateStatus().
#define ENTER_CRITICAL_SECTION | ( | cs | ) |
Definition at line 160 of file sync.h.
Referenced by CNode::BeginMessage(), and locking_callback().
#define LEAVE_CRITICAL_SECTION | ( | cs | ) |
Definition at line 166 of file sync.h.
Referenced by CNode::AbortMessage(), CNode::EndMessage(), and locking_callback().
#define LOCK | ( | cs | ) | CCriticalBlock criticalblock(cs, #cs, __FILE__, __LINE__) |
Definition at line 156 of file sync.h.
Referenced by AcceptBlock(), AcceptToMemoryPool(), ActivateBestChain(), CAddrMan::Add(), CCryptoKeyStore::AddCryptedKey(), CWallet::AddCryptedKey(), CBasicKeyStore::AddCScript(), CNode::AddInventoryKnown(), CBasicKeyStore::AddKeyPubKey(), CCryptoKeyStore::AddKeyPubKey(), AddLocal(), addnode(), AddOneShot(), AddressTableModel::addRow(), AddTimeData(), AddToBlockIndex(), CWallet::AddToWallet(), CTxMemPool::AddTransactionsUpdated(), CTxMemPool::addUnchecked(), AdvertizeLocal(), CAddrMan::Attempt(), BackupWallet(), CNode::Ban(), CDB::CDB(), WalletModel::changePassphrase(), CWallet::ChangeWalletPassphrase(), CTxMemPool::check(), CAddrMan::Check(), mastercore::ClassB_send(), CTxMemPool::clear(), CDB::Close(), CDBEnv::CloseDb(), CNode::CNode(), CAddrMan::Connected(), ConnectNode(), CopyNodeStats(), CWallet::DelAddressBook(), CCryptoKeyStore::EncryptKeys(), CWallet::EncryptWallet(), CWallet::EraseFromWallet(), CRPCTable::execute(), CTxMemPool::exists(), PaymentServer::fetchPaymentACK(), MatrixModel::fillin(), FindBlockPos(), FindNode(), FindUndoPos(), CWalletDB::FindWalletTx(), CDBEnv::Flush(), FlushBlockFile(), CWalletTx::GetAccountAmounts(), getaddednodeinfo(), CAddrMan::GetAddr(), CWallet::GetAddressBalances(), CAlert::getAlertByHash(), getconnectioncount(), CBasicKeyStore::GetCScript(), GetDataDir(), CWallet::GetDebit(), mastercore::GetHeight(), CBasicKeyStore::GetKey(), CCryptoKeyStore::GetKey(), CWallet::GetKeyFromPool(), CBasicKeyStore::GetKeys(), getLabel(), ClientModel::getLastBlockDate(), mastercore::GetLatestBlockTime(), GetLocal(), CMPTally::getMoney(), getMPbalance(), GetNameProxy(), getnetworkinfo(), GetNodeStateStats(), ClientModel::getNumBlocks(), ClientModel::getNumConnections(), WalletModel::getNumTransactions(), GetProxy(), CCryptoKeyStore::GetPubKey(), getrawmempool(), CWalletTx::GetRequestCount(), mastercore::getTally(), GetTimeOffset(), CNode::GetTotalBytesRecv(), CNode::GetTotalBytesSent(), mastercore::getTotalTokens(), GetTransaction(), CTxMemPool::GetTransactionsUpdated(), gettxout(), ClientModel::getVerificationProgress(), CWallet::GetVersion(), CWallet::GetWalletTx(), GetWarnings(), CAddrMan::Good(), CBasicKeyStore::HaveCScript(), CBasicKeyStore::HaveKey(), CCryptoKeyStore::HaveKey(), HaveNameProxy(), CAddrMan::IMPLEMENT_SERIALIZE(), InitBlockIndex(), CWallet::Inventory(), CNode::IsBanned(), CWallet::IsChange(), IsInitialBlockDownload(), IsLimited(), IsLocal(), CCryptoKeyStore::IsLocked(), CWallet::IsMine(), IsProxy(), IsReachable(), AddressTableModel::labelForAddress(), listaddressgroupings(), listtransactions_MP(), LoadExternalBlockFile(), WalletModel::loadReceiveRequests(), CWalletDB::LoadWallet(), CWallet::LoadWallet(), CCryptoKeyStore::Lock(), LockWallet(), CTxMemPool::lookup(), CWallet::MarkDirty(), CWallet::NewKeyPool(), ping(), CAlert::ProcessAlert(), ProcessGetData(), ProcessMessage(), ProcessOneShot(), CTxMemPool::pruneSpent(), CNode::PushInventory(), CTxMemPool::queryHashes(), CWallet::ReacceptWalletTransactions(), CNode::RecordBytesRecv(), CNode::RecordBytesSent(), AddressTablePriv::refreshAddressTable(), msc_AddressTablePriv::refreshAddressTable(), RelayTransaction(), CTxMemPool::remove(), CTxMemPool::removeConflicts(), CDBEnv::RemoveDb(), AddressTableModel::removeRows(), CWalletDB::ReorderTransactions(), CWallet::ResendWalletTransactions(), CWallet::ReserveKeyFromKeyPool(), CWallet::ReturnKey(), CDB::Rewrite(), CDBEnv::Salvage(), WalletModel::saveReceiveRequest(), SeenLocal(), CAddrMan::Select(), selectCoins(), WalletModel::sendCoins(), SendMessages(), CWallet::SetAddressBook(), CCryptoKeyStore::SetCrypted(), AddressTableModel::setData(), SetLimited(), CWallet::SetMaxVersion(), CWallet::SetMinVersion(), SetNameProxy(), SetProxy(), SetReachable(), Shutdown(), signrawtransaction(), CTxMemPool::size(), ThreadDNSAddressSeed(), ThreadMessageHandler(), ThreadOpenAddedConnections(), ThreadOpenConnections(), ThreadSocketHandler(), CWallet::TopUpKeyPool(), CCryptoKeyStore::Unlock(), CWallet::Unlock(), mastercore::update_tally_map(), CWallet::UpdatedTransaction(), CMPTally::updateMoney(), SendMPDialog::updateProperty(), CDBEnv::Verify(), VerifyDB(), walletlock(), walletpassphrase(), write_msc_balances(), and CWallet::ZapWalletTx().
#define LOCK2 | ( | cs1, | |
cs2 | |||
) | CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__),criticalblock2(cs2, #cs2, __FILE__, __LINE__) |
Definition at line 157 of file sync.h.
Referenced by CWallet::AddReserveKey(), CWallet::AvailableCoins(), CWallet::CommitTransaction(), CreateNewBlock(), TransactionTablePriv::describe(), CRPCTable::execute(), CWallet::GetAllReserveKeys(), CWallet::GetBalance(), CWallet::GetImmatureBalance(), WalletModel::getOutputs(), CWallet::GetUnconfirmedBalance(), importprivkey(), WalletModel::isLockedCoin(), WalletModel::isSpent(), WalletModel::listCoins(), WalletModel::listLockedCoins(), WalletModel::lockCoin(), WalletModel::prepareTransaction(), ProcessMessage(), CWallet::ReacceptWalletTransactions(), TransactionTablePriv::refreshWallet(), CWallet::ScanForWalletTransactions(), WalletModel::sendCoins(), CWallet::SyncTransaction(), TransactionDesc::toHTML(), WalletModel::unlockCoin(), and TransactionTablePriv::updateWallet().
#define TRY_LOCK | ( | cs, | |
name | |||
) | CCriticalBlock name(cs, #cs, __FILE__, __LINE__, true) |
Definition at line 158 of file sync.h.
Referenced by CNode::CloseSocketDisconnect(), TransactionTablePriv::index(), WalletModel::pollBalanceChanged(), SendMessages(), Shutdown(), ThreadFlushWalletDB(), ThreadMessageHandler(), ThreadSocketHandler(), and ClientModel::updateTimer().
typedef CMutexLock<CCriticalSection> CCriticalBlock |
typedef AnnotatedMixin<boost::recursive_mutex> CCriticalSection |
typedef AnnotatedMixin<boost::mutex> CWaitableCriticalSection |
|
inlinestatic |
|
inlinestatic |
Definition at line 93 of file sync.h.
Referenced by CMutexLock< Mutex >::Enter(), and CMutexLock< Mutex >::TryEnter().
|
inlinestatic |
Definition at line 94 of file sync.h.
Referenced by CMutexLock< Mutex >::TryEnter(), and CMutexLock< Mutex >::~CMutexLock().