Skip to content

Commit

Permalink
Worker thread of Client class should not sleep when stopping
Browse files Browse the repository at this point in the history
https://github.com/ethereum/cpp-ethereum/pull/4948/files#r180332663

When there is a request to stop the thread, the thread should not enter
the sleeping state to wait for something else.
  • Loading branch information
pirapira committed Apr 10, 2018
1 parent ae2e122 commit 7ced86e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libethereum/Client.cpp
Expand Up @@ -693,7 +693,7 @@ void Client::doWork(bool _doWait)
isSealed = m_working.isSealed();
// If the block is sealed, we have to wait for it to tickle through the block queue
// (which only signals as wanting to be synced if it is ready).
if (!m_syncBlockQueue && !m_syncTransactionQueue && (_doWait || isSealed))
if (!m_syncBlockQueue && !m_syncTransactionQueue && (_doWait || isSealed) && isWorking())
{
std::unique_lock<std::mutex> l(x_signalled);
m_signalled.wait_for(l, chrono::seconds(1));
Expand Down

0 comments on commit 7ced86e

Please sign in to comment.