Merge #5955: refactor: simply RecursiveMutex -> Mutex

a09e260c15 refacotor: simply RecursiveMutex -> Mutex (pasta)

Pull request description:

  ## What was done?
  This PR is a simpler version of https://github.com/dashpay/dash/pull/5954; it is simply a recursiveMutex -> Mutex PR; as I think some of the scope minimization in the other PR introduced test failures (appears there are undocumented mutex dependancies)

  ## How Has This Been Tested?
  CI TBD

  ## Breaking Changes
  None

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK a09e260c15

Tree-SHA512: 4ef5aa94ecb1a55f30b642d5e0328e2d2a0adcf2ccc2ab6489a576a420c915339be023828785c3243f019bb73ac2cd77be7dd4397e14ec874cba68999a9e54dc
This commit is contained in:
pasta 2024-03-25 11:05:59 -05:00
commit 9201529b8e
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
4 changed files with 5 additions and 5 deletions

View File

@ -104,7 +104,7 @@ class CCreditPoolManager
{
private:
static constexpr size_t CreditPoolCacheSize = 1000;
RecursiveMutex cache_mutex;
Mutex cache_mutex;
unordered_lru_cache<uint256, CCreditPool, StaticSaltedHasher> creditPoolCache GUARDED_BY(cache_mutex) {CreditPoolCacheSize};
CEvoDB& evoDb;

View File

@ -42,7 +42,7 @@ private:
CDeterministicMNManager& m_dmnman;
CEvoDB& m_evoDb;
mutable RecursiveMutex minableCommitmentsCs;
mutable Mutex minableCommitmentsCs;
std::map<std::pair<Consensus::LLMQType, uint256>, uint256> minableCommitmentsByQuorum GUARDED_BY(minableCommitmentsCs);
std::map<uint256, CFinalCommitment> minableCommitments GUARDED_BY(minableCommitmentsCs);

View File

@ -45,7 +45,7 @@ private:
//TODO name struct instead of std::pair
std::map<std::pair<Consensus::LLMQType, int>, CDKGSessionHandler> dkgSessionHandlers;
mutable RecursiveMutex contributionsCacheCs;
mutable Mutex contributionsCacheCs;
struct ContributionsCacheKey {
Consensus::LLMQType llmqType;
uint256 quorumHash;

View File

@ -226,9 +226,9 @@ private:
const CSporkManager& m_sporkman;
const std::unique_ptr<CMasternodeSync>& m_mn_sync;
mutable RecursiveMutex cs_map_quorums;
mutable Mutex cs_map_quorums;
mutable std::map<Consensus::LLMQType, unordered_lru_cache<uint256, CQuorumPtr, StaticSaltedHasher>> mapQuorumsCache GUARDED_BY(cs_map_quorums);
mutable RecursiveMutex cs_scan_quorums;
mutable Mutex cs_scan_quorums;
mutable std::map<Consensus::LLMQType, unordered_lru_cache<uint256, std::vector<CQuorumCPtr>, StaticSaltedHasher>> scanQuorumsCache GUARDED_BY(cs_scan_quorums);
mutable Mutex cs_cleanup;
mutable std::map<Consensus::LLMQType, unordered_lru_cache<uint256, uint256, StaticSaltedHasher>> cleanupQuorumsCache GUARDED_BY(cs_cleanup);