Use a semaphore to trigger shutdown procedures #13186

pull skeees wants to merge 1 commits into bitcoin:master from skeees:shutdown-cv changing 3 files +11 −4
  1. skeees commented at 6:49 pm on May 7, 2018: contributor
    Very simple cleanup to avoid sleep waiting on the fShutdownRequested flag
  2. Use a semaphore to trigger shutdown procedures c3c665c4a6
  3. in src/init.cpp:134 in 1fce55619c outdated
    130@@ -131,16 +131,26 @@ static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat";
    131 //
    132 
    133 std::atomic<bool> fRequestShutdown(false);
    134+std::atomic<bool> fDumpMempoolLater(false);
    


    MarcoFalke commented at 6:53 pm on May 7, 2018:
    Unused and unrelated?

    skeees commented at 6:53 pm on May 7, 2018:
    must be a stray rebase - will fix
  4. skeees force-pushed on May 7, 2018
  5. sipa commented at 7:06 pm on May 7, 2018: member
    I think this breaks SIGINT/SIGTERM handling.
  6. skeees commented at 8:03 pm on May 7, 2018: contributor
    Yes - you’re right :( let me see if there’s an easy safe way to do that, but might be more trouble than its worth.
  7. sipa commented at 8:07 pm on May 7, 2018: member
    You can use a condition variable and have a loop with short-timeout waits on it. The signal handlers can’t do anything but set variables, and will need a wait loop, but everything else can use condition variable waking.
  8. fanquake added the label Refactoring on May 7, 2018
  9. laanwj commented at 5:54 am on May 8, 2018: member

    You can’t use mutexes inside signal handlers. What would work is to create a pipe (and write/read a byte from it).

    See also discussion in #10873. e.g. #10873 (review)

  10. laanwj commented at 5:29 pm on May 10, 2018: member
    Closing in favor of #13211.
  11. laanwj closed this on May 10, 2018

  12. MarcoFalke 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: 2024-12-23 00:13 UTC

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