diff options
| author | MarcoFalke <[email protected]> | 2020-02-21 09:20:51 -0800 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-02-21 10:06:21 -0800 |
| commit | fa9af06d91e9357e86863781746f0e78a509967e (patch) | |
| tree | 84da5bbd0c028648b9ec383dabc80849d2f15d18 /src/rpc/server.cpp | |
| parent | util: Add UnintrruptibleSleep (diff) | |
| download | discoin-fa9af06d91e9357e86863781746f0e78a509967e.tar.xz discoin-fa9af06d91e9357e86863781746f0e78a509967e.zip | |
scripted-diff: Replace MilliSleep with UninterruptibleSleep
This is safe because MilliSleep is never executed in a boost::thread,
the only type of thread that is interruptible.
* The RPC server uses std::thread
* The wallet is either executed in an RPC thread or the main thread
* bitcoin-cli, benchmarks and tests are only one thread (the main thread)
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/MilliSleep\((\S+)\);/UninterruptibleSleep(std::chrono::milliseconds{\1});/g' $(git grep -l MilliSleep)
-END VERIFY SCRIPT-
Diffstat (limited to 'src/rpc/server.cpp')
| -rw-r--r-- | src/rpc/server.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index b62490ed2..4670a28a1 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -169,7 +169,7 @@ UniValue stop(const JSONRPCRequest& jsonRequest) // this reply will get back to the client. StartShutdown(); if (jsonRequest.params[0].isNum()) { - MilliSleep(jsonRequest.params[0].get_int()); + UninterruptibleSleep(std::chrono::milliseconds{jsonRequest.params[0].get_int()}); } return PACKAGE_NAME " stopping"; } |