Refactoring and small improvements to async rpc operations.

Added AsyncRPCQueue::closeAndWait() so rpcserver can block on worker threads when shutting down.
AsyncRPCOperation is no longer copyable - copy constructor and assignment operators now private.
Refactoring: renamed methods, renamed member variables
Tidy up: comments, const, size_t, braces
This commit is contained in:
Simon
2016-08-28 19:50:39 -07:00
parent 34f0001ccc
commit 3b54bf5813
6 changed files with 272 additions and 207 deletions

View File

@@ -809,8 +809,8 @@ void StopRPCThreads()
delete rpc_io_service; rpc_io_service = NULL;
// Tells async queue to cancel all operations and shutdown.
// The async queue destructor will block and join on worker threads.
async_rpc_queue->close();
LogPrintf("%s: waiting for async rpc workers to stop\n", __func__);
async_rpc_queue->closeAndWait();
}
bool IsRPCRunning()