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

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:missing-net-locks changing 2 files +26 −14
  1. practicalswift commented at 4:39 PM on November 21, 2017: contributor

    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
  2. net: Add missing locks in net.{cpp,h}
    * 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
    63f21d27ee
  3. practicalswift force-pushed on Nov 21, 2017
  4. fanquake added the label P2P on Nov 21, 2017
  5. sipa commented at 11:43 PM on November 21, 2017: member

    These look right to me, and a bit scary. Opinions, @theuni?

  6. TheBlueMatt commented at 12:06 AM on November 22, 2017: member

    @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 notifications@github.com 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: https://github.com/bitcoin/bitcoin/pull/11744

  7. Add Clang thread safety analysis annotations bfb0c0a5b7
  8. practicalswift commented at 7:02 AM on November 23, 2017: contributor

    I've now added a commit which adds Clang thread safety analysis annotations.

  9. theuni approved
  10. theuni commented at 12:52 AM on November 29, 2017: member

    utACK bfb0c0a5b75da43d6aa829ef5d632fa9c56c51e7

  11. laanwj commented at 10:52 AM on November 30, 2017: member

    Nice. utACK bfb0c0a

  12. laanwj merged this on Nov 30, 2017
  13. laanwj closed this on Nov 30, 2017

  14. laanwj referenced this in commit 3ff6ff5ec5 on Nov 30, 2017
  15. PastaPastaPasta referenced this in commit 4159ed2deb on Jan 17, 2020
  16. PastaPastaPasta referenced this in commit 6d85dceec5 on Jan 22, 2020
  17. PastaPastaPasta referenced this in commit 356bf3c0fc on Jan 22, 2020
  18. PastaPastaPasta referenced this in commit 6214c4cb16 on Jan 26, 2020
  19. PastaPastaPasta referenced this in commit 500a60a8fe on Jan 27, 2020
  20. PastaPastaPasta referenced this in commit 51f6519f1a on Jan 29, 2020
  21. PastaPastaPasta referenced this in commit 44578884fb on Jan 29, 2020
  22. PastaPastaPasta referenced this in commit ec782b9310 on Jan 29, 2020
  23. ckti referenced this in commit 54a2e50ae3 on Mar 28, 2021
  24. practicalswift deleted the branch on Apr 10, 2021
  25. furszy referenced this in commit 97728e5673 on Dec 7, 2021
  26. gades referenced this in commit 8d076c24af on Feb 10, 2022
  27. DrahtBot locked this on Aug 16, 2022

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: 2026-04-13 18:15 UTC

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