Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

sync.h File Reference
#include <threadsafety.h>
#include <condition_variable>
#include <thread>
#include <mutex>
+ Include dependency graph for sync.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AnnotatedMixin< PARENT >
 Template mixin that adds -Wthread-safety locking annotations to a subset of the mutex API. More...
 
class  CCriticalSection
 Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the recursive lock by default. More...
 
class  CCriticalBlock
 Wrapper around std::unique_lock<CCriticalSection> More...
 
class  CSemaphore
 
class  CSemaphoreGrant
 RAII-style semaphore lock. More...
 

Macros

#define AssertLockHeld(cs)   AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
 
#define AssertLockNotHeld(cs)   AssertLockNotHeldInternal(#cs, __FILE__, __LINE__, &cs)
 
#define PASTE(x, y)   x ## y
 
#define PASTE2(x, y)   PASTE(x, y)
 
#define LOCK(cs)   CCriticalBlock PASTE2(criticalblock, __COUNTER__)(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< std::mutex > CWaitableCriticalSection
 Wrapped mutex: supports waiting but not recursive locking. More...
 
typedef std::condition_variable CConditionVariable
 Just a typedef for std::condition_variable, can be wrapped later if desired. More...
 
typedef std::unique_lock< std::mutex > WaitableLock
 Just a typedef for std::unique_lock, can be wrapped later if desired. More...
 

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)
 
static void AssertLockNotHeldInternal (const char *pszName, const char *pszFile, int nLine, void *cs)
 
static void DeleteLock (void *cs)
 

Macro Definition Documentation

◆ AssertLockHeld

#define AssertLockHeld (   cs)    AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)

Definition at line 87 of file sync.h.

◆ AssertLockNotHeld

◆ ENTER_CRITICAL_SECTION

#define ENTER_CRITICAL_SECTION (   cs)
Value:
{ \
EnterCritical(#cs, __FILE__, __LINE__, (void*)(&cs)); \
(cs).lock(); \
}

Definition at line 182 of file sync.h.

Referenced by CCheckQueueControl< T >::CCheckQueueControl(), getblocktemplate(), locking_callback(), and CGovernanceManager::ProcessVote().

◆ LEAVE_CRITICAL_SECTION

#define LEAVE_CRITICAL_SECTION (   cs)
Value:
{ \
(cs).unlock(); \
LeaveCritical(); \
}

Definition at line 188 of file sync.h.

Referenced by getblocktemplate(), locking_callback(), CGovernanceManager::ProcessVote(), and CCheckQueueControl< T >::~CCheckQueueControl().

◆ LOCK

#define LOCK (   cs)    CCriticalBlock PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__)

Definition at line 178 of file sync.h.

Referenced by CConnman::AcceptConnection(), CGovernanceManager::AcceptObjectMessage(), AcceptToMemoryPoolWorker(), CGovernanceManager::AcceptVoteMessage(), CChainState::ActivateBestChain(), CAddrMan::Add(), CHDChain::AddAccount(), CTxMemPool::addAddressIndex(), CGovernanceManager::AddCachedTriggers(), CCryptoKeyStore::AddCryptedKey(), CWallet::AddCryptedKey(), CBasicKeyStore::AddCScript(), CPrivateSend::AddDSTX(), CNetFulfilledRequestManager::AddFulfilledRequest(), CMasternodeMetaInfo::AddGovernanceVote(), CMasternodeMetaMan::AddGovernanceVote(), CNode::AddInventoryKnown(), CKeyHolderStorage::AddKey(), AddKey(), CBasicKeyStore::AddKeyPubKey(), CCryptoKeyStore::AddKeyPubKey(), AddLocal(), llmq::CQuorumBlockProcessor::AddMinableCommitment(), CConnman::AddNode(), CConnman::AddOneShot(), CTransactionBuilder::AddOutput(), CConnman::AddPendingMasternode(), CConnman::AddPendingProbeConnections(), CGovernanceManager::AddPostponedObject(), AddressTableModel::addRow(), CTxMemPool::addSpentIndex(), AddTimeData(), SingleThreadedSchedulerClient::AddToProcessQueue(), CWallet::AddToWallet(), CTxMemPool::AddTransactionsUpdated(), AddTx(), ListCoinsTestingSetup::AddTx(), CTxMemPool::addUnchecked(), AddWallet(), CBasicKeyStore::AddWatchOnly(), CMasternodeMetaMan::AllowMixing(), llmq::CChainLocksHandler::AlreadyHave(), llmq::CSigningManager::AlreadyHave(), llmq::CInstantSendManager::AlreadyHave(), AlreadyHave(), AppInitMain(), CTxMemPool::ApplyDelta(), CGovernanceManager::AreRateChecksEnabled(), llmq::CInstantSendManager::AskNodesForLockedTx(), llmq::CSigSharesManager::AsyncSign(), llmq::CSigningManager::AsyncSignIfMember(), CAddrMan::Attempt(), CConnman::AttemptToEvictConnection(), BerkeleyDatabase::Backup(), CConnman::Ban(), CConnman::BannedSetIsDirty(), llmq::CSigSharesManager::BanNode(), CEvoDB::BeginTransaction(), BerkeleyBatch::BerkeleyBatch(), PeerLogicValidation::BlockChecked(), llmq::CChainLocksHandler::BlockConnected(), llmq::CInstantSendManager::BlockConnected(), CPrivateSend::BlockConnected(), llmq::CChainLocksHandler::BlockDisconnected(), llmq::CInstantSendManager::BlockDisconnected(), CPrivateSend::BlockDisconnected(), CWallet::BlockUntilSyncedToCurrentChain(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BuildSimplifiedMNListDiff(), CalcCbTxMerkleRootMNList(), llmq::CLLMQUtils::CalcDeterministicWatchConnections(), CalculateCurrentUsage(), CTxMemPool::CalculateMemPoolAncestors(), SingleThreadedSchedulerClient::CallbacksPending(), WalletModel::changePassphrase(), CWallet::ChangeWalletPassphrase(), CAddrMan::Check(), CTxMemPool::check(), llmq::CChainLocksHandler::CheckActiveState(), CNetFulfilledRequestManager::CheckAndRemove(), CSporkManager::CheckAndRemove(), CChainState::CheckBlockIndex(), llmq::CInstantSendManager::CheckCanLock(), CPrivateSend::CheckDSTXes(), PeerLogicValidation::CheckForStaleTipAndEvictPeers(), CConnman::CheckIncomingNonce(), CheckInputsFromMempoolAndCache(), CPrivateSendClientManager::CheckTimeout(), CGovernanceManager::CleanOrphanObjects(), llmq::CChainLocksHandler::Cleanup(), llmq::CSigSharesManager::Cleanup(), llmq::CDKGSessionManager::CleanupCache(), llmq::CRecoveredSigsDb::CleanupOldRecoveredSigs(), CNetFulfilledRequestManager::Clear(), llmq::CDKGPendingMessages::Clear(), CTransactionBuilder::Clear(), CMasternodeMetaMan::Clear(), CSporkManager::Clear(), CGovernanceManager::Clear(), CAddrMan::Clear(), CTxMemPool::clear(), CConnman::ClearBanned(), ClearDatadirCache(), CGovernanceObject::ClearMasternodeVotes(), CTxMemPool::ClearPrioritisation(), BerkeleyBatch::Close(), BerkeleyEnvironment::CloseDb(), CNode::CloseSocketDisconnect(), CoinSelection(), llmq::CSigningManager::CollectPendingRecoveredSigsToVerify(), llmq::CSigSharesManager::CollectPendingSigSharesToVerify(), combinerawtransaction(), CTransactionBuilder::Commit(), CEvoDB::CommitCurTransaction(), CWallet::CommitTransaction(), CTxMemPool::CompareDepthAndScore(), ComputeBlockVersion(), CGovernanceManager::ConfirmInventoryRequest(), CChainState::ConnectBlock(), CAddrMan::Connected(), CConnman::ConnectNode(), CPrivateSendServer::ConsumeCollateral(), CConnman::CopyNodeVector(), CNode::copyStats(), CHDChain::CountAccounts(), CGovernanceObject::CountMatchingVotes(), CPrivateSendClientSession::CreateDenominated(), CWallet::CreateTransaction(), CWallet::CreateWalletFromFile(), CTransactionBuilder::CTransactionBuilder(), decoderawtransaction(), CWallet::DelAddressBook(), CMasternodeMetaMan::DisallowMixing(), CConnman::DisconnectNode(), CConnman::DisconnectNodes(), CPrivateSendClientSession::DoAutomaticDenominating(), CPrivateSendClientManager::DoAutomaticDenominating(), llmq::CChainLocksHandler::DoInvalidateBlock(), dumphdinfo(), DumpMempool(), CTxMemPool::DynamicMemoryUsage(), SingleThreadedSchedulerClient::EmptyQueue(), CCryptoKeyStore::EncryptKeys(), CWallet::EncryptWallet(), llmq::CChainLocksHandler::EnforceBestChainLock(), CEvoDB::Erase(), EraseOrphansFor(), CBlockPolicyEstimator::estimateRawFee(), CBlockPolicyEstimator::estimateSmartFee(), PeerLogicValidation::EvictExtraOutboundPeers(), CRPCTable::execute(), CSuperblockManager::ExecuteBestSuperblock(), CEvoDB::Exists(), CTxMemPool::exists(), CTxMemPool::existsProviderTxConflict(), CTxMemPool::Expire(), PeerLogicValidation::FinalizeNode(), FindBlockPos(), CGovernanceManager::FindGovernanceObject(), CConnman::FindNode(), FindUndoPos(), BerkeleyEnvironment::Flush(), FlushBlockFile(), FlushStateToDisk(), CBlockPolicyEstimator::FlushUnconfirmed(), llmq::CSigSharesManager::ForceReAnnouncement(), ArgsManager::ForceRemoveArg(), ArgsManager::ForceSetArg(), CConnman::ForEachNode(), CConnman::ForEachNodeContinueIf(), CConnman::ForEachNodeThen(), CConnman::ForNode(), CWallet::FundTransaction(), CConnman::GenerateSelectSet(), CTxMemPool::get(), CHDChain::GetAccount(), CWallet::GetAccountAddresses(), CConnman::GetAddedNodeInfo(), CAddrMan::GetAddr(), CWallet::GetAddressBalances(), CTxMemPool::getAddressIndex(), CAddrMan::GetAddressInfo(), CNode::GetAddrLocal(), CNode::GetAddrName(), CGovernanceManager::GetAllNewerThan(), CMasternodeMetaMan::GetAndClearDirtyGovernanceObjectHashes(), ArgsManagerHelper::GetArg(), ArgsManager::GetArgs(), CConnman::GetBanned(), getbestblockhash(), llmq::CChainLocksHandler::GetBestChainLock(), getbestchainlock(), getblock(), getblockchaininfo(), getblockcount(), GetBlockFileInfo(), GetBlockHash(), getblockhash(), getblockheader(), getblockheaders(), getblockstats(), getblocktemplate(), CMasternodePayments::GetBlockTxOuts(), llmq::CChainLocksHandler::GetBlockTxs(), CWallet::GetCappedOutpointPrivateSendRounds(), llmq::CChainLocksHandler::GetChainLockByHash(), getchaintips(), getchaintxstats(), CreateTransactionTestSetup::GetCoins(), llmq::CInstantSendManager::GetConflictingLock(), CBasicKeyStore::GetCScript(), CBasicKeyStore::GetCScripts(), CGovernanceObject::GetCurrentMNVotes(), CGovernanceManager::GetCurrentVotes(), GetDataDir(), CWallet::GetDebit(), CWallet::GetDecryptedHDChain(), CWallet::GetDestValues(), getdifficulty(), CMasternodeMetaMan::GetDsqCount(), CMasternodeMetaMan::GetDsqThreshold(), CPrivateSend::GetDSTX(), CConnman::GetExtraOutboundCount(), GetfLargeWorkForkFound(), getgovernanceinfo(), ClientModel::getHeaderTipHeight(), ClientModel::getHeaderTipTime(), llmq::CInstantSendManager::GetInstantSendLockByHash(), llmq::CInstantSendManager::GetInstantSendLockHashByTxid(), CPrivateSendClientManager::GetJsonInfo(), CBasicKeyStore::GetKey(), CCryptoKeyStore::GetKey(), CWallet::GetKey(), CWallet::GetKeyFromPool(), CBasicKeyStore::GetKeys(), CCryptoKeyStore::GetKeys(), ClientModel::getLastBlockDate(), ClientModel::getLastBlockHash(), CMasternodeMetaInfo::GetLastDsq(), CMasternodeMetaInfo::GetLastOutboundAttempt(), CMasternodeMetaInfo::GetLastOutboundSuccess(), CDeterministicMNManager::GetListAtChainTip(), CDeterministicMNManager::GetListForBlock(), GetLocal(), llmq::CDKGDebugManager::GetLocalDebugStatus(), ClientModel::getMasternodeList(), CConnman::GetMasternodeQuorums(), CConnman::GetMaxOutboundTarget(), CConnman::GetMaxOutboundTimeframe(), CConnman::GetMaxOutboundTimeLeftInCycle(), getmempoolancestors(), getmempooldescendants(), getmempoolentry(), getmerkleblocks(), CMasternodeMetaMan::GetMetaInfo(), llmq::CQuorumBlockProcessor::GetMinableCommitment(), llmq::CQuorumBlockProcessor::GetMinableCommitmentByHash(), llmq::CQuorumBlockProcessor::GetMinedCommitmentsUntilBlock(), CTxMemPool::GetMinFee(), getmininginfo(), CPrivateSendClientManager::GetMixingMasternodesInfo(), CMasternodeMetaInfo::GetMixingTxCount(), GetNameProxy(), getnetworkhashps(), getnetworkinfo(), CConnman::GetNodeCount(), GetNodeStateStats(), CConnman::GetNodeStats(), GetnScore(), ClientModel::getNumBlocks(), CWallet::GetOldestKeyPoolTime(), CConnman::GetOutboundTargetBytesLeft(), llmq::CDKGSessionHandler::GetPhaseAndQuorumHash(), CMasternodeMetaInfo::GetProTxHash(), GetProxy(), CBasicKeyStore::GetPubKey(), CCryptoKeyStore::GetPubKey(), CWallet::GetPubKey(), llmq::CQuorumManager::GetQuorum(), getrawtransaction(), CWallet::GetRealOutpointPrivateSendRounds(), CSuperblockManager::GetRequiredPaymentsString(), GetRequiredPaymentsStrings(), MasternodeList::GetSelectedDIP3MN(), CPrivateSendClientManager::GetSessionDenoms(), llmq::CSigSharesManager::GetSessionInfoByRecvId(), llmq::GetSimulatedErrorRate(), getspecialtxes(), GetSpendHeight(), CTxMemPool::getSpentIndex(), CSporkManager::GetSporkByHash(), CSporkManager::GetSporkValue(), CPrivateSendClientManager::GetStatuses(), CSuperblockManager::GetSuperblockPayments(), GetTimeOffset(), CConnman::GetTotalBytesRecv(), CConnman::GetTotalBytesSent(), CTxMemPool::GetTotalTxSize(), GetTransaction(), CTxMemPool::GetTransactionsUpdated(), gettxout(), gettxoutproof(), GetUTXOCoin(), GetUTXOConfirmations(), GetUTXOStats(), ClientModel::getVerificationProgress(), llmq::CDKGSessionManager::GetVerifiedContribution(), CWallet::GetVersion(), CGovernanceManager::GetVoteCount(), GetWallet(), GetWalletEnv(), GetWallets(), CWallet::GetWalletTx(), GetWarnings(), gobject_getcurrentvotes(), gobject_submit(), gobject_vote_conf(), CAddrMan::Good(), llmq::CDKGSessionHandler::HandleDKGRound(), llmq::CInstantSendManager::HandleFullyConfirmedBlock(), MasternodeList::handleMasternodeListChanged(), llmq::CInstantSendManager::HandleNewInstantSendLockRecoveredSig(), llmq::CChainLocksHandler::HandleNewRecoveredSig(), llmq::CInstantSendManager::HandleNewRecoveredSig(), llmq::CSigSharesManager::HandleNewRecoveredSig(), llmq::CChainLocksHandler::HasChainLock(), llmq::CChainLocksHandler::HasConflictingChainLock(), CNetFulfilledRequestManager::HasFulfilledRequest(), CConnman::HasMasternodeQuorumNodes(), llmq::CQuorumBlockProcessor::HasMinableCommitment(), llmq::CQuorumBlockProcessor::HasMinedCommitment(), llmq::CRecoveredSigsDb::HasRecoveredSigForHash(), llmq::CRecoveredSigsDb::HasRecoveredSigForId(), llmq::CRecoveredSigsDb::HasRecoveredSigForSession(), llmq::CDKGPendingMessages::HasSeen(), CBlockTreeDB::HasTxIndex(), HasWallets(), CBasicKeyStore::HaveCScript(), CBasicKeyStore::HaveKey(), CCryptoKeyStore::HaveKey(), CWallet::HaveKey(), HaveNameProxy(), CGovernanceManager::HaveObjectForHash(), CGovernanceManager::HaveVoteForHash(), CBasicKeyStore::HaveWatchOnly(), importprunedfunds(), CTxMemPool::info(), CTxMemPool::infoAll(), CActiveMasternodeManager::Init(), CConnman::Init(), PartiallyDownloadedBlock::InitData(), CDSNotificationInterface::InitializeCurrentBlockTip(), PeerLogicValidation::InitializeNode(), llmq::CDKGDebugManager::InitLocalSessionStatus(), CGovernanceManager::InitOnLoad(), invalidateblock(), CWallet::IsAllFromMe(), ArgsManager::IsArgNegated(), CConnman::IsBanned(), CWallet::IsChange(), CPrivateSend::IsCollateralValid(), CWallet::IsDenominated(), CDeterministicMNManager::IsDIP3Enforced(), IsInitialBlockDownload(), IsLimited(), IsLocal(), llmq::CInstantSendManager::IsLocked(), CCryptoKeyStore::IsLocked(), CConnman::IsMasternodeQuorumNode(), CWallet::IsMine(), IsProxy(), IsReachable(), CTxMemPool::isSpent(), CSuperblockManager::IsSuperblockTriggered(), llmq::CChainLocksHandler::IsTxSafeForMining(), CSuperblockManager::IsValid(), CKeyHolderStorage::KeepAll(), AddressTableModel::labelForDestination(), LimitOrphanTxSize(), listwallets(), LoadExternalBlockFile(), CChainState::LoadGenesisBlock(), LoadMempool(), GUIUtil::loadStyleSheet(), CCryptoKeyStore::Lock(), LockWallet(), CPrivateSendClientSession::MakeCollateralAmounts(), CWallet::MarkDirty(), masternode_winners(), masternodelist(), CGovernanceManager::MasternodeRateCheck(), SingleThreadedSchedulerClient::MaybeScheduleProcessQueue(), CNode::MaybeSetAddrName(), mempoolToJSON(), CWallet::NewKeyPool(), PeerLogicValidation::NewPoWValidBlock(), CZMQPublishRawBlockNotifier::NotifyBlock(), CZMQPublishRawChainLockNotifier::NotifyChainLock(), CZMQPublishRawChainLockSigNotifier::NotifyChainLock(), NotifyHeaderTip(), CMNAuth::NotifyMasternodeListChanged(), CConnman::NotifyNumConnectionsChanged(), CWallet::NotifyTransactionLock(), CConnman::OpenNetworkConnection(), CConnman::OutboundTargetReached(), ArgsManager::ParseParameters(), llmq::CDKGPendingMessages::PopPendingMessages(), CChainState::PreciousBlock(), preciousblock(), PrepareShutdown(), WalletModel::prepareTransaction(), prioritisetransaction(), CTxMemPool::PrioritiseTransaction(), CBlockPolicyEstimator::processBlock(), CDeterministicMNManager::ProcessBlock(), llmq::CQuorumBlockProcessor::ProcessCommitment(), ProcessGetBlockData(), ProcessGetData(), ProcessHeadersMessage(), llmq::CInstantSendManager::ProcessInstantSendLock(), llmq::CQuorumBlockProcessor::ProcessMessage(), CMNAuth::ProcessMessage(), llmq::CDKGSessionManager::ProcessMessage(), CPrivateSendServer::ProcessMessage(), CPrivateSendClientManager::ProcessMessage(), CGovernanceManager::ProcessMessage(), ProcessMessage(), llmq::CSigSharesManager::ProcessMessageBatchedSigShares(), llmq::CSigSharesManager::ProcessMessageGetSigShares(), llmq::CInstantSendManager::ProcessMessageInstantSendLock(), llmq::CSigningManager::ProcessMessageRecoveredSig(), PeerLogicValidation::ProcessMessages(), llmq::CSigSharesManager::ProcessMessageSigSesAnn(), llmq::CSigSharesManager::ProcessMessageSigShare(), llmq::CSigSharesManager::ProcessMessageSigSharesInv(), ProcessNewBlock(), ProcessNewBlockHeaders(), llmq::CChainLocksHandler::ProcessNewChainLock(), llmq::CInstantSendManager::ProcessNewTransaction(), CConnman::ProcessOneShot(), CPrivateSendClientManager::ProcessPendingDsaRequest(), llmq::CInstantSendManager::ProcessPendingInstantSendLocks(), llmq::ProcessPendingMessageBatch(), llmq::CSigningManager::ProcessPendingReconstructedRecoveredSigs(), llmq::CSigningManager::ProcessPendingRecoveredSigs(), llmq::CInstantSendManager::ProcessPendingRetryLockTxs(), SingleThreadedSchedulerClient::ProcessQueue(), llmq::CSigningManager::ProcessRecoveredSig(), llmq::CSigSharesManager::ProcessSigShare(), CSporkManager::ProcessSpork(), CBlockPolicyEstimator::processTransaction(), llmq::CInstantSendManager::ProcessTx(), CGovernanceObject::ProcessVote(), protx_diff(), protx_list(), pruneblockchain(), PruneOneBlockFile(), CNode::PushBlockHash(), CNode::PushInventory(), CConnman::PushMessage(), CMNAuth::PushMNAUTH(), llmq::CDKGPendingMessages::PushPendingMessage(), llmq::CSigningManager::PushReconstructedRecoveredSig(), CTxMemPool::queryHashes(), quorum_dkgstatus(), quorum_info(), quorum_list(), quorum_memberof(), CWallet::ReacceptWalletTransactions(), CEvoDB::Read(), CBlockPolicyEstimator::Read(), ReadBlockFromDisk(), ArgsManager::ReadConfigFile(), ArgsManager::ReadConfigStream(), CBlockTreeDB::ReadTxIndex(), CGovernanceManager::RebuildIndexes(), CChainState::ReceivedBlockTransactions(), llmq::CDKGSession::ReceiveMessage(), CNode::ReceiveMsgBytes(), reconsiderblock(), CConnman::RecordBytesRecv(), CConnman::RecordBytesSent(), WalletBatch::RecoverKeysOnlyFilter(), AddressTablePriv::refreshAddressTable(), ClientModel::refreshMasternodeList(), CConnman::RegisterEvents(), llmq::CSigningManager::RegisterRecoveredSigsListener(), CConnman::RelayInv(), CConnman::RelayInvFiltered(), llmq::CDKGSession::RelayInvToParticipants(), CConnman::RelayTransaction(), CConnman::RemoveAddedNode(), CTxMemPool::removeAddressIndex(), CNetFulfilledRequestManager::RemoveAllFulfilledRequests(), llmq::CInstantSendManager::RemoveChainLockConflictingLock(), CTxMemPool::removeConflicts(), CTxMemPool::removeForBlock(), CTxMemPool::removeForReorg(), CNetFulfilledRequestManager::RemoveFulfilledRequest(), CMasternodeMetaInfo::RemoveGovernanceObject(), CMasternodeMetaMan::RemoveGovernanceObject(), CGovernanceObject::RemoveInvalidVotes(), CGovernanceManager::RemoveInvalidVotes(), RemoveLocal(), CConnman::RemoveMasternodeQuorumNodes(), llmq::CInstantSendManager::RemoveMempoolConflictsForLock(), llmq::CRecoveredSigsDb::RemoveRecoveredSig(), CTxMemPool::removeRecursive(), AddressTableModel::removeRows(), CTxMemPool::removeSpentIndex(), CBlockPolicyEstimator::removeTx(), RemoveWallet(), CBasicKeyStore::RemoveWatchOnly(), CWallet::ReorderTransactions(), CChainState::ReplayBlocks(), CGovernanceManager::RequestGovernanceObject(), CGovernanceManager::RequestGovernanceObjectVotes(), CGovernanceManager::RequestOrphanObjects(), rescanblockchain(), CWallet::RescanFromTime(), resendwallettransactions(), CWallet::ReserveKeyFromKeyPool(), llmq::CDKGDebugManager::ResetLocalSessionStatus(), CPrivateSendClientManager::ResetPool(), llmq::CInstantSendManager::ResolveBlockConflicts(), rest_block(), rest_headers(), CKeyHolderStorage::ReturnAll(), CWallet::ReturnKey(), BerkeleyBatch::Rewrite(), CEvoDB::RollbackCurTransaction(), RPCIsInWarmup(), BerkeleyEnvironment::Salvage(), WalletModel::saveReceiveRequest(), CWallet::ScanForWalletTransactions(), llmq::CQuorumManager::ScanQuorums(), SeenLocal(), CAddrMan::Select(), llmq::CSigningManager::SelectQuorumForSigning(), SendBlockTransactions(), WalletModel::sendCoins(), sendfrom(), sendmany(), PeerLogicValidation::SendMessages(), llmq::CSigSharesManager::SendMessages(), sendrawtransaction(), sendtoaddress(), CNetFulfilledRequestManager::SerializationOp(), CMasternodeMetaInfo::SerializationOp(), CHDChain::SerializationOp(), CMasternodeMetaMan::SerializationOp(), CGovernanceManager::SerializationOp(), CAddrMan::Serialize(), CGovernanceManager::SerializeObjectForHash(), CGovernanceManager::SerializeVoteForHash(), CHDChain::SetAccount(), CWallet::SetAddressBook(), CNode::SetAddrLocal(), CConnman::SetBanned(), CConnman::SetBannedSetDirty(), CCryptoKeyStore::SetCrypted(), CWallet::SetCryptedHDChain(), AddressTableModel::setData(), SetfLargeWorkForkFound(), SetfLargeWorkInvalidChainFound(), CWallet::SetHDChain(), CMasternodeMetaInfo::SetLastOutboundAttempt(), CMasternodeMetaInfo::SetLastOutboundSuccess(), SetLimited(), ClientModel::setMasternodeList(), CConnman::SetMasternodeQuorumNodes(), CConnman::SetMaxOutboundTarget(), CConnman::SetMaxOutboundTimeframe(), CWallet::SetMaxVersion(), CWallet::SetMinVersion(), SetMiscWarning(), setmocktime(), SetNameProxy(), CHDChain::SetNull(), CPrivateSendBaseSession::SetNull(), CPrivateSendBaseManager::SetNull(), CSporkManager::SetPrivKey(), SetProxy(), SetRPCWarmupFinished(), SetRPCWarmupStatus(), CAddrMan::SetServices(), llmq::SetSimulatedDKGErrorRate(), CSporkManager::SetSporkAddress(), llmq::CSigSharesManager::Sign(), llmq::CSigSharesManager::SignPendingSigShares(), signrawtransaction(), CAddrMan::size(), CTxMemPool::size(), llmq::CDKGSessionHandler::SleepBeforePhase(), CConnman::SocketHandler(), CConnman::SocketRecvData(), CConnman::SocketSendData(), ArgsManager::SoftSetArg(), CSporkManager::SporkValueIsActive(), CConnman::Start(), CConnman::Stop(), submitblock(), CPrivateSendClientSession::SubmitDenominate(), CConnman::SweepBanned(), CGovernanceManager::SyncObjects(), CConnman::ThreadDNSAddressSeed(), ThreadImport(), CConnman::ThreadMessageHandler(), CConnman::ThreadOpenConnections(), llmq::CDKGDebugSessionStatus::ToJson(), CGovernanceManager::ToJson(), CWallet::TopUpKeyPool(), CSporkManager::ToString(), CGovernanceManager::ToString(), llmq::CChainLocksHandler::TransactionAddedToMempool(), CPrivateSend::TransactionAddedToMempool(), CWallet::TransactionRemovedFromMempool(), CTxMemPool::TransactionWithinChainLimit(), CTxMemPool::TrimToSize(), llmq::CRecoveredSigsDb::TruncateRecoveredSig(), llmq::CSigSharesManager::TryRecoverSig(), llmq::CChainLocksHandler::TrySignChainTip(), llmq::CInstantSendManager::TrySignInstantSendLock(), CConnman::Unban(), llmq::CQuorumBlockProcessor::UndoBlock(), CDeterministicMNManager::UndoBlock(), UnloadBlockIndex(), CCryptoKeyStore::Unlock(), CWallet::Unlock(), CConnman::UnregisterEvents(), llmq::CSigningManager::UnregisterRecoveredSigsListener(), CAddrMan::Unserialize(), CTransactionBuilderOutput::UpdateAmount(), CActiveMasternodeManager::UpdatedBlockTip(), llmq::CChainLocksHandler::UpdatedBlockTip(), llmq::CDKGSessionHandler::UpdatedBlockTip(), CDeterministicMNManager::UpdatedBlockTip(), MasternodeList::updateDIP3List(), UpdateLastBlockAnnounceTime(), llmq::CDKGDebugManager::UpdateLocalMemberStatus(), llmq::CDKGDebugManager::UpdateLocalSessionStatus(), CGovernanceObject::UpdateLocalValidity(), CSporkManager::UpdateSpork(), CTxMemPool::UpdateTransactionsFromBlock(), llmq::CQuorumBlockProcessor::UpgradeDB(), CDeterministicMNManager::UpgradeDBIfNeeded(), validateaddress(), BerkeleyEnvironment::Verify(), CWallet::Verify(), verifychain(), CVerifyDB::VerifyDB(), verifymessage(), verifytxoutproof(), VersionBitsTipStateSinceHeight(), VersionBitsTipStatistics(), voteraw(), VoteWithMasternodes(), CEvoDB::Write(), CBlockPolicyEstimator::Write(), llmq::CRecoveredSigsDb::WriteRecoveredSig(), CBlockTreeDB::WriteTxIndex(), and CWallet::ZapWalletTx().

◆ LOCK2

#define LOCK2 (   cs1,
  cs2 
)    CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__), criticalblock2(cs2, #cs2, __FILE__, __LINE__)

Definition at line 179 of file sync.h.

Referenced by WalletModel::abandonTransaction(), CWallet::AbandonTransaction(), abandontransaction(), llmq::CChainLocksHandler::AcceptedBlockHeader(), CGovernanceManager::AddGovernanceObject(), addmultisigaddress(), CWallet::AutoBackupWallet(), CWallet::AutoLockMasternodeCollaterals(), CWallet::AvailableCoins(), backupwallet(), PeerLogicValidation::BlockConnected(), CWallet::BlockConnected(), CWallet::BlockDisconnected(), BOOST_FIXTURE_TEST_CASE(), CGovernanceManager::CheckPostponedObjects(), llmq::CChainLocksHandler::Cleanup(), CWallet::CommitTransaction(), CWallet::CountInputsWithAmount(), CWallet::CreateCollateralTransaction(), CPrivateSendClientSession::CreateDenominated(), BlockAssembler::CreateNewBlock(), CWallet::CreateTransaction(), TransactionTablePriv::describe(), CPrivateSendClientSession::DoAutomaticDenominating(), dumpprivkey(), dumpwallet(), encryptwallet(), FindFilesToPrune(), FindFilesToPruneManual(), CWallet::FundTransaction(), getaccount(), getaccountaddress(), getaddressesbyaccount(), CWallet::GetAnonymizedBalance(), CWallet::GetAvailableBalance(), CWallet::GetAverageAnonymizedRounds(), getbalance(), CWallet::GetBalance(), CWallet::GetCollateralTxDSIn(), llmq::CDKGSessionManager::GetComplaint(), llmq::CDKGSessionManager::GetContribution(), CWallet::GetDenominatedBalance(), CWallet::GetImmatureBalance(), CWallet::GetImmatureWatchOnlyBalance(), llmq::CDKGSessionManager::GetJustification(), CWallet::GetLegacyBalance(), CConnman::GetMasternodeQuorumNodes(), getnewaddress(), CWallet::GetNormalizedAnonymizedBalance(), WalletModel::getOutputs(), llmq::CDKGSessionManager::GetPrematureCommitment(), getrawchangeaddress(), getreceivedbyaccount(), getreceivedbyaddress(), gettransaction(), TransactionTablePriv::getTxHex(), getunconfirmedbalance(), CWallet::GetUnconfirmedBalance(), CWallet::GetUnconfirmedWatchOnlyBalance(), getwalletinfo(), CWallet::GetWatchOnlyBalance(), gobject_get(), importaddress(), importelectrumwallet(), importmulti(), importprivkey(), importprunedfunds(), importpubkey(), importwallet(), WalletModel::isLockedCoin(), WalletModel::isSpent(), keypoolrefill(), listaccounts(), listaddressbalances(), listaddressgroupings(), CWallet::ListCoins(), WalletModel::listLockedCoins(), listlockunspent(), ListObjects(), WalletModel::listProTxCoins(), listreceivedbyaccount(), listreceivedbyaddress(), listsinceblock(), listtransactions(), listunspent(), WalletBatch::LoadWallet(), CWallet::LoadWallet(), WalletModel::lockCoin(), lockunspent(), CPrivateSendClientSession::MakeCollateralAmounts(), CWallet::MarkConflicted(), movecmd(), WalletModel::prepareTransaction(), CGovernanceManager::ProcessMessage(), ProcessMessage(), PeerLogicValidation::ProcessMessages(), llmq::CChainLocksHandler::ProcessNewChainLock(), protx_list(), llmq::CDKGPendingMessages::PushPendingMessage(), CWallet::ReacceptWalletTransactions(), TransactionTablePriv::refreshWallet(), llmq::CSigSharesManager::RemoveBannedNodeStates(), removeprunedfunds(), CGovernanceManager::RequestGovernanceObjectVotes(), resendwallettransactions(), CWallet::ResendWalletTransactionsBefore(), rest_getutxos(), CWallet::ScanForWalletTransactions(), CWallet::SelectCoinsGroupedByAddresses(), WalletModel::sendCoins(), sendfrom(), sendmany(), PeerLogicValidation::SendMessages(), sendtoaddress(), setaccount(), settxfee(), signmessage(), CConnman::SocketHandler(), CPrivateSendClientSession::SubmitDenominate(), CGovernanceManager::SyncObjects(), CGovernanceManager::SyncSingleObjVotes(), CConnman::ThreadOpenMasternodeConnections(), TransactionDesc::toHTML(), CWallet::TransactionAddedToMempool(), CWallet::TransactionCanBeAbandoned(), WalletModel::unlockCoin(), CGovernanceManager::UpdateCachesAndClean(), TransactionTablePriv::updateWallet(), validateaddress(), walletlock(), walletpassphrase(), and walletpassphrasechange().

◆ PASTE

#define PASTE (   x,
 
)    x ## y

Definition at line 175 of file sync.h.

◆ PASTE2

#define PASTE2 (   x,
 
)    PASTE(x, y)

Definition at line 176 of file sync.h.

◆ TRY_LOCK

Typedef Documentation

◆ CConditionVariable

typedef std::condition_variable CConditionVariable

Just a typedef for std::condition_variable, can be wrapped later if desired.

Definition at line 106 of file sync.h.

◆ CWaitableCriticalSection

Wrapped mutex: supports waiting but not recursive locking.

Definition at line 103 of file sync.h.

◆ WaitableLock

typedef std::unique_lock<std::mutex> WaitableLock

Just a typedef for std::unique_lock, can be wrapped later if desired.

Definition at line 109 of file sync.h.

Function Documentation

◆ AssertLockHeldInternal()

static void AssertLockHeldInternal ( const char *  pszName,
const char *  pszFile,
int  nLine,
void *  cs 
)
inlinestatic

Definition at line 83 of file sync.h.

◆ AssertLockNotHeldInternal()

static void AssertLockNotHeldInternal ( const char *  pszName,
const char *  pszFile,
int  nLine,
void *  cs 
)
inlinestatic

Definition at line 84 of file sync.h.

◆ DeleteLock()

static void DeleteLock ( void *  cs)
inlinestatic

Definition at line 85 of file sync.h.

Referenced by CCriticalSection::~CCriticalSection().

◆ EnterCritical()

static void EnterCritical ( const char *  pszName,
const char *  pszFile,
int  nLine,
void *  cs,
bool  fTry = false 
)
inlinestatic

Definition at line 81 of file sync.h.

Referenced by CCriticalBlock::Enter(), and CCriticalBlock::TryEnter().

◆ LeaveCritical()

static void LeaveCritical ( )
inlinestatic

Definition at line 82 of file sync.h.

Referenced by CCriticalBlock::TryEnter(), and CCriticalBlock::~CCriticalBlock().

Released under the MIT license