shutdown.cpp 499 B

123456789101112131415161718192021222324
  1. // Copyright (c) 2009-2010 Satoshi Nakamoto
  2. // Copyright (c) 2009-2018 The Bitcoin Core developers
  3. // Distributed under the MIT software license, see the accompanying
  4. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  5. #include <shutdown.h>
  6. #include <atomic>
  7. static std::atomic<bool> fRequestShutdown(false);
  8. void StartShutdown()
  9. {
  10. fRequestShutdown = true;
  11. }
  12. void AbortShutdown()
  13. {
  14. fRequestShutdown = false;
  15. }
  16. bool ShutdownRequested()
  17. {
  18. return fRequestShutdown;
  19. }