mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-12-22 19:39:22 +00:00
Tari poll loop - bring two exit checks together
This commit is contained in:
parent
6f22dfca11
commit
58dc32dd97
1 changed files with 1 additions and 5 deletions
|
@ -187,13 +187,9 @@ void MergeMiningClientTari::run()
|
||||||
|
|
||||||
LOGINFO(6, "Tari height = " << response2.block().header().height());
|
LOGINFO(6, "Tari height = " << response2.block().header().height());
|
||||||
|
|
||||||
if (m_workerStop.load() != 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int64_t timeout = std::max<int64_t>(500'000'000 - duration_cast<nanoseconds>(high_resolution_clock::now() - t1).count(), 1'000'000);
|
const int64_t timeout = std::max<int64_t>(500'000'000 - duration_cast<nanoseconds>(high_resolution_clock::now() - t1).count(), 1'000'000);
|
||||||
|
|
||||||
if (uv_cond_timedwait(&m_workerCond, &m_workerLock, timeout) != UV_ETIMEDOUT) {
|
if ((m_workerStop.load() != 0) || (uv_cond_timedwait(&m_workerCond, &m_workerLock, timeout) != UV_ETIMEDOUT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue