-
Notifications
You must be signed in to change notification settings - Fork 38.7k
net: Add missing locks in net.{cpp,h} #11744
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* writing variable 'nTotalBytesRecv' requires holding mutex 'cs_totalBytesRecv' exclusively * writing variables 'nTotalBytesSent'/'nMaxOutboundTotalBytesSentInCycle'/'nMaxOutboundCycleStartTime' require holding mutex 'cs_totalBytesSent' exclusively * writing variable 'nMaxOutboundTimeframe'/'nMaxOutboundLimit' require holding mutex 'cs_totalBytesSent' exclusively * writing variable 'vAddedNodes' requires holding mutex 'cs_vAddedNodes' exclusively
f24c28a to
63f21d2
Compare
Member
|
These look right to me, and a bit scary. Opinions, @theuni? |
Contributor
|
@sipa These are just constructor/Start accesses, which are fine unlocked so it's not an issue, just a static analysis fixes.
…On November 21, 2017 8:39:39 AM PST, practicalswift ***@***.***> wrote:
Add missing locks in `net.{cpp,h}`:
* writing variable `nTotalBytesRecv` requires holding mutex
`cs_totalBytesRecv` exclusively
* writing variables `nTotalBytesSent`,
`nMaxOutboundTotalBytesSentInCycle` and `nMaxOutboundCycleStartTime`
require holding mutex `cs_totalBytesSent` exclusively
* writing variables `nMaxOutboundTimeframe` and `nMaxOutboundLimit`
require holding mutex `cs_totalBytesSent` exclusively
* writing variable `vAddedNodes` requires holding mutex
`cs_vAddedNodes` exclusively
You can view, comment on, or merge this pull request online at:
#11744
-- Commit Summary --
* net: Add missing locks in net.{cpp,h}
-- File Changes --
M src/net.cpp (14)
M src/net.h (12)
-- Patch Links --
https://github.com/bitcoin/bitcoin/pull/11744.patch
https://github.com/bitcoin/bitcoin/pull/11744.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#11744
|
Contributor
Author
|
I've now added a commit which adds Clang thread safety analysis annotations. |
theuni
approved these changes
Nov 29, 2017
Member
theuni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK bfb0c0a
Member
|
Nice. utACK bfb0c0a |
laanwj
added a commit
that referenced
this pull request
Nov 30, 2017
bfb0c0a Add Clang thread safety analysis annotations (practicalswift) 63f21d2 net: Add missing locks in net.{cpp,h} (practicalswift) Pull request description: Add missing locks in `net.{cpp,h}`: * writing variable `nTotalBytesRecv` requires holding mutex `cs_totalBytesRecv` exclusively * writing variables `nTotalBytesSent`, `nMaxOutboundTotalBytesSentInCycle` and `nMaxOutboundCycleStartTime` require holding mutex `cs_totalBytesSent` exclusively * writing variables `nMaxOutboundTimeframe` and `nMaxOutboundLimit` require holding mutex `cs_totalBytesSent` exclusively * writing variable `vAddedNodes` requires holding mutex `cs_vAddedNodes` exclusively Tree-SHA512: 54a5b4bc6dc6f404dacf403af2ddd7b2214cc0a17d1d32a282def1c6b536105dada56bfabbc8606f56755f2d24874abba09913b51c8d13b0f2b000149551f0b0
30 tasks
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Jan 27, 2020
bfb0c0a Add Clang thread safety analysis annotations (practicalswift) 63f21d2 net: Add missing locks in net.{cpp,h} (practicalswift) Pull request description: Add missing locks in `net.{cpp,h}`: * writing variable `nTotalBytesRecv` requires holding mutex `cs_totalBytesRecv` exclusively * writing variables `nTotalBytesSent`, `nMaxOutboundTotalBytesSentInCycle` and `nMaxOutboundCycleStartTime` require holding mutex `cs_totalBytesSent` exclusively * writing variables `nMaxOutboundTimeframe` and `nMaxOutboundLimit` require holding mutex `cs_totalBytesSent` exclusively * writing variable `vAddedNodes` requires holding mutex `cs_vAddedNodes` exclusively Tree-SHA512: 54a5b4bc6dc6f404dacf403af2ddd7b2214cc0a17d1d32a282def1c6b536105dada56bfabbc8606f56755f2d24874abba09913b51c8d13b0f2b000149551f0b0
furszy
added a commit
to PIVX-Project/PIVX
that referenced
this pull request
Dec 7, 2021
e1d12d3 Add Clang thread safety analysis annotations (furszy) 5716940 net: Add missing locks in net.{cpp,h} (furszy) 8c02b59 net: simplify fRelayTxes flag processing (furszy) 71667df remove unused IsArgSet check (Marko Bencun) 729c63d add m_added_nodes to connman options (Marko Bencun) 8c8ad18 [net] Fix use of uninitialized value in getnetworkinfo(const JSONRPCRequest& request) (practicalswift) a13b7c9 Add vConnect to CConnman::Options (Marko Bencun) 987342e ActiveMasternode: fix not initialized socket. (furszy) 8d788ba add SeedNodes to CConnman::Options (Marko Bencun) d9e91ff add Binds, WhiteBinds to CConnman::Options (Marko Bencun) 41c89af add WhitelistedRange to CConnman::Options (Marko Bencun) Pull request description: More groundwork for the LLMQ sessions connections work, built on top of #2586 and #2587 (starts in 10efb72a). Focused on cleaning the connman init/start by decoupling the command line arguments. Backported PRs list: * bitcoin#10467. * bitcoin#10496. * bitcoin#10596. * bitcoin#10977. * bitcoin#11301. * bitcoin#11744 (partially, without the outbound members changes as we don't have them). ACKs for top commit: random-zebra: utACK e1d12d3 Fuzzbawls: ACK e1d12d3 Tree-SHA512: 81a1ab7a1e7f487330354631ee728be9ec78223fe4978c8b9c97b7fbc8d2bfe4f4ea9e88ac4a3d1f0553f7adad871c81261b1a7545bae710a4e3200b8a5031d7
gades
pushed a commit
to cosanta/cosanta-core
that referenced
this pull request
Feb 10, 2022
bfb0c0a Add Clang thread safety analysis annotations (practicalswift) 63f21d2 net: Add missing locks in net.{cpp,h} (practicalswift) Pull request description: Add missing locks in `net.{cpp,h}`: * writing variable `nTotalBytesRecv` requires holding mutex `cs_totalBytesRecv` exclusively * writing variables `nTotalBytesSent`, `nMaxOutboundTotalBytesSentInCycle` and `nMaxOutboundCycleStartTime` require holding mutex `cs_totalBytesSent` exclusively * writing variables `nMaxOutboundTimeframe` and `nMaxOutboundLimit` require holding mutex `cs_totalBytesSent` exclusively * writing variable `vAddedNodes` requires holding mutex `cs_vAddedNodes` exclusively Tree-SHA512: 54a5b4bc6dc6f404dacf403af2ddd7b2214cc0a17d1d32a282def1c6b536105dada56bfabbc8606f56755f2d24874abba09913b51c8d13b0f2b000149551f0b0
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add missing locks in
net.{cpp,h}:nTotalBytesRecvrequires holding mutexcs_totalBytesRecvexclusivelynTotalBytesSent,nMaxOutboundTotalBytesSentInCycleandnMaxOutboundCycleStartTimerequire holding mutexcs_totalBytesSentexclusivelynMaxOutboundTimeframeandnMaxOutboundLimitrequire holding mutexcs_totalBytesSentexclusivelyvAddedNodesrequires holding mutexcs_vAddedNodesexclusively