doc: Add cs_main lock annotations for mapBlockIndex #15321

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1902-docLoc changing 3 files +6 −3
  1. MarcoFalke commented at 8:05 pm on February 1, 2019: member
    Marked as “doc” because it didn’t change the bitcoind on my system with default configure settings for both gcc and clang.
  2. MarcoFalke added the label Docs on Feb 1, 2019
  3. MarcoFalke added the label Refactoring on Feb 1, 2019
  4. MarcoFalke removed the label Docs on Feb 1, 2019
  5. in src/validation.cpp:3619 in fabc580e41 outdated
    3615@@ -3616,7 +3616,7 @@ uint64_t CalculateCurrentUsage()
    3616 }
    3617 
    3618 /* Prune a block file (modify associated database entries)*/
    3619-void PruneOneBlockFile(const int fileNumber)
    3620+void PruneOneBlockFile(const int fileNumber) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
    


    practicalswift commented at 8:16 pm on February 1, 2019:
    Shouldn’t this annotation be in src/validation.h instead?
  6. practicalswift commented at 8:16 pm on February 1, 2019: contributor

    Concept ACK

    Thanks for adding this missing annotation.

  7. MarcoFalke force-pushed on Feb 1, 2019
  8. MarcoFalke force-pushed on Feb 1, 2019
  9. doc: Add cs_main lock annotations for mapBlockIndex fa2a69fcb9
  10. MarcoFalke force-pushed on Feb 1, 2019
  11. promag commented at 1:31 am on February 2, 2019: member
    Concept ACK.
  12. in src/validation.h:291 in fa2a69fcb9
    287@@ -288,7 +288,7 @@ uint64_t CalculateCurrentUsage();
    288 /**
    289  *  Mark one block file as pruned.
    290  */
    291-void PruneOneBlockFile(const int fileNumber);
    292+void PruneOneBlockFile(const int fileNumber) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
    


    promag commented at 1:32 am on February 2, 2019:
    Is this necessary?

    Empact commented at 7:45 am on February 4, 2019:

    Without it I get:

    0  CXX      wallet/libbitcoin_wallet_a-wallet.o
    1validation.cpp:3623:28: warning: reading variable 'mapBlockIndex' requires holding mutex 'cs_main' [-Wthread-safety-analysis]
    2    for (const auto& entry : mapBlockIndex) {
    3                           ^
    4validation.cpp:3623:28: warning: reading variable 'mapBlockIndex' requires holding mutex 'cs_main' [-Wthread-safety-analysis]
    5  CXX      wallet/libbitcoin_wallet_a-walletdb.o
    
  13. MarcoFalke referenced this in commit 5cdb82111c on Feb 6, 2019
  14. MarcoFalke merged this on Feb 6, 2019
  15. MarcoFalke closed this on Feb 6, 2019

  16. MarcoFalke deleted the branch on Feb 6, 2019
  17. deadalnix referenced this in commit 07d651060a on Mar 26, 2020
  18. LarryRuane referenced this in commit 3a318e2886 on Apr 29, 2021
  19. LarryRuane referenced this in commit 48b5161d99 on Jun 1, 2021
  20. Munkybooty referenced this in commit 8fa36b45df on Aug 23, 2021
  21. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me