HomePhabricator

Merge #11744: net: Add missing locks in net.{cpp,h}

Description

Merge #11744: net: Add missing locks in net.{cpp,h}

Summary:
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

Backport of Core PR 11744
https://github.com/bitcoin/bitcoin/pull/11744/files

Test Plan:
make check
test_runner.py

Reviewers: deadalnix, Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D2972

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Nov 30 2017, 10:32
jasonbcoxCommitted on May 8 2019, 17:58
jasonbcoxPushed on May 8 2019, 17:58
Reviewer
Restricted Project
Differential Revision
D2972: Merge #11744: net: Add missing locks in net.{cpp,h}
Parents
rABC54ac1d870374: Revert removal of code block
Branches
Unknown
Tags
Unknown

Event Timeline