Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Add cs_main lock annotations for mapBlockIndex #15321

Merged
merged 1 commit into from Feb 6, 2019

Conversation

@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Feb 1, 2019

Marked as "doc" because it didn't change the bitcoind on my system with default configure settings for both gcc and clang.

src/validation.cpp Outdated Show resolved Hide resolved
@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Feb 1, 2019

Concept ACK

Thanks for adding this missing annotation.

@MarcoFalke MarcoFalke force-pushed the Mf1902-docLoc branch 2 times, most recently from fa5349e to fa36350 Feb 1, 2019
Copy link
Member

@promag promag left a comment

Concept ACK.

@@ -288,7 +288,7 @@ uint64_t CalculateCurrentUsage();
/**
* Mark one block file as pruned.
*/
void PruneOneBlockFile(const int fileNumber);
void PruneOneBlockFile(const int fileNumber) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
Copy link
Member

@promag promag Feb 2, 2019

Is this necessary?

Copy link
Member

@Empact Empact Feb 4, 2019

Without it I get:

  CXX      wallet/libbitcoin_wallet_a-wallet.o
validation.cpp:3623:28: warning: reading variable 'mapBlockIndex' requires holding mutex 'cs_main' [-Wthread-safety-analysis]
    for (const auto& entry : mapBlockIndex) {
                           ^
validation.cpp:3623:28: warning: reading variable 'mapBlockIndex' requires holding mutex 'cs_main' [-Wthread-safety-analysis]
  CXX      wallet/libbitcoin_wallet_a-walletdb.o

@Empact
Copy link
Member

@Empact Empact commented Feb 4, 2019

utACK fa2a69f

MarcoFalke added a commit to MarcoFalke/bitcoin-core that referenced this issue Feb 6, 2019
fa2a69f doc: Add cs_main lock annotations for mapBlockIndex (practicalswift)

Pull request description:

  Marked as "doc" because it didn't change the bitcoind on my system with default configure settings for both gcc and clang.

Tree-SHA512: ba203f16c1cdc834a61c65bb5fb20bbaf7d8bff0c3a1b8ef46bc1d3669092191221e26abd7e580efab2f9bd5a992dc363251f1b68c6cd68f8204d62675868cf1
@MarcoFalke MarcoFalke merged commit fa2a69f into bitcoin:master Feb 6, 2019
2 checks passed
@MarcoFalke MarcoFalke deleted the Mf1902-docLoc branch Feb 6, 2019
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this issue Mar 26, 2020
Summary:
```
Previously the argument would be untouched if the first block scan
failed. This makes the behavior predictable, and consistent with the
documentation.
```

Backport of core [[bitcoin/bitcoin#14957 | PR14957]] and the remaining of [[bitcoin/bitcoin#15321 | PR15321]] (see D5238).

Depends on D5563.

Test Plan:
With Clang:
  cmake -GNinja .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=ON
  ninja all check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5564
LarryRuane added a commit to LarryRuane/zcash that referenced this issue Apr 29, 2021
LarryRuane added a commit to LarryRuane/zcash that referenced this issue Jun 1, 2021
Munkybooty added a commit to Munkybooty/dash that referenced this issue Aug 23, 2021
fa2a69f doc: Add cs_main lock annotations for mapBlockIndex (practicalswift)

Pull request description:

  Marked as "doc" because it didn't change the bitcoind on my system with default configure settings for both gcc and clang.

Tree-SHA512: ba203f16c1cdc834a61c65bb5fb20bbaf7d8bff0c3a1b8ef46bc1d3669092191221e26abd7e580efab2f9bd5a992dc363251f1b68c6cd68f8204d62675868cf1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants