Cleaned up critical section code. #602

pull cgaebel wants to merge 2 commits into bitcoin:master from cgaebel:master changing 2 files +34 −9
  1. cgaebel commented at 8:35 AM on November 2, 2011: none

    Instead of using an ugly loop hack that swallows break and continue, I have replaced it with a simple if statement.

    Please comment and/or apply!

  2. Cleaned up the critical section macros. 3083cf100a
  3. laanwj commented at 9:08 AM on November 2, 2011: member

    I like this; it uses the proper c++ idiom (RAII) which is more readable and potentially more robust.

    Can you add testcase/unittest?

  4. Added simple critical section test cases. f873b84d6e
  5. cgaebel commented at 10:11 PM on November 2, 2011: none

    Done. Thanks.

  6. gavinandresen commented at 10:41 PM on November 9, 2011: contributor

    ACK

  7. TheBlueMatt commented at 2:14 AM on November 10, 2011: member

    It would be nice to test that Critical section code actually works by spawning threads and testing locks in the test suite.

  8. gavinandresen commented at 7:32 PM on November 21, 2011: contributor

    I'm going to merge this early-- writing multithreaded unit tests would be spiffy, but second-best is to merge early and get lots of testing.

  9. gavinandresen referenced this in commit 42eb76a054 on Nov 21, 2011
  10. gavinandresen merged this on Nov 21, 2011
  11. gavinandresen closed this on Nov 21, 2011

  12. coblee referenced this in commit 6901f28573 on Jul 17, 2012
  13. ptschip referenced this in commit 24658df3dd on Aug 19, 2017
  14. kallewoof referenced this in commit 2c56e0d2b3 on Oct 4, 2019
  15. rajarshimaitra referenced this in commit 4fb21e5a8c on Aug 5, 2021
  16. DrahtBot locked this on Sep 8, 2021

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-15 15:16 UTC

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