Skip to content

Commit

Permalink
Merge #5955: refactor: simply RecursiveMutex -> Mutex
Browse files Browse the repository at this point in the history
a09e260 refacotor: simply RecursiveMutex -> Mutex (pasta)

Pull request description:

  ## What was done?
  This PR is a simpler version of #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 a09e260

Tree-SHA512: 4ef5aa94ecb1a55f30b642d5e0328e2d2a0adcf2ccc2ab6489a576a420c915339be023828785c3243f019bb73ac2cd77be7dd4397e14ec874cba68999a9e54dc
  • Loading branch information
PastaPastaPasta committed Mar 25, 2024
2 parents 4301ab9 + a09e260 commit 9201529
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/evo/creditpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/blockprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CQuorumBlockProcessor
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);

Expand Down
2 changes: 1 addition & 1 deletion src/llmq/dkgsessionmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CDKGSessionManager
//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;
Expand Down
4 changes: 2 additions & 2 deletions src/llmq/quorums.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ class CQuorumManager
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);
Expand Down

0 comments on commit 9201529

Please sign in to comment.