[net] Thread safety annotations in net_processing#13423
[net] Thread safety annotations in net_processing#13423laanwj merged 2 commits intobitcoin:masterfrom
Conversation
8bea6e5 to
7bf1391
Compare
3002c61 to
00c1bae
Compare
|
Concept ACK. Well done in 4c0b978, improves thread safety analysis in a lot of places. |
|
utACK 00c1bae9091447229cd09b5146ee25a357f592fe (although I'm not an expert on cs_main) |
00c1bae to
af288e3
Compare
|
@DrahtBot - rebased |
Note to reviewers: This pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
reACK af288e3f09f0724390334d9902742883a9db388e |
af288e3 to
4d3732d
Compare
4d3732d to
6a2e1ee
Compare
|
rebased now that #13417 has been merged |
src/net_processing.cpp
Outdated
There was a problem hiding this comment.
Can remove the now redundant mention of cs_main here?
src/net_processing.cpp
Outdated
There was a problem hiding this comment.
Same here (and everywhere else)
|
|
||
| /** Increase a node's misbehavior score. */ | ||
| void Misbehaving(NodeId nodeid, int howmuch, const std::string& message=""); | ||
| void Misbehaving(NodeId nodeid, int howmuch, const std::string& message="") EXCLUSIVE_LOCKS_REQUIRED(cs_main); |
There was a problem hiding this comment.
nit: should prefix this with static to make sure the annotation is properly added where this function is declared.
There was a problem hiding this comment.
sorry - don't quite understand - this is also used in src/test/denialofservice_tests.cpp
wouldn't declaring static break that?
There was a problem hiding this comment.
Ah, I see. Thanks for the clarification. I only built bitcoind to check my patch.
1e3bcd2 [net_processing] Add thread safety annotations (Jesse Cohen) f393a53 Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis (Jesse Cohen) Pull request description: (note that this depends on bitcoin#13417) This commit fully annotates all globals in net_processing with clang thread safety annotations. Subsequent commits will begin transitioning some of this data away from cs_main into locks that are local to net_processing. Static thread safety analysis should it easier to verify correctness of that process. Tree-SHA512: b47aa410cb9ada21072370176aea9a74c575643fa1ee8cf1d43c8e28675eef17f33e5242ac422f840e8178e132ecb58412034c6334b68f1b57c686df80d4e8e2
…analysis zcash: cherry picked from commit f393a53 zcash: bitcoin/bitcoin#13423
zcash: cherry picked from commit 1e3bcd2 zcash: bitcoin/bitcoin#13423
…analysis zcash: cherry picked from commit f393a53 zcash: bitcoin/bitcoin#13423
zcash: cherry picked from commit 1e3bcd2 zcash: bitcoin/bitcoin#13423
(note that this depends on #13417)
This commit fully annotates all globals in net_processing with clang thread safety annotations. Subsequent commits will begin transitioning some of this data away from cs_main into locks that are local to net_processing. Static thread safety analysis should it easier to verify correctness of that process.