mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-10 21:04:37 +00:00
Fixed exit condition for RxQueue.
This commit is contained in:
parent
8af1075c98
commit
0a1836e5a8
1 changed files with 5 additions and 4 deletions
|
@ -132,15 +132,15 @@ bool xmrig::RxQueue::isReadyUnsafe(const Job &job) const
|
|||
|
||||
void xmrig::RxQueue::backgroundInit()
|
||||
{
|
||||
while (true) {
|
||||
while (m_state != STATE_SHUTDOWN) {
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
|
||||
if (m_state == STATE_IDLE) {
|
||||
m_cv.wait(lock, [this]{ return m_state != STATE_IDLE; });
|
||||
}
|
||||
|
||||
if (m_state == STATE_SHUTDOWN) {
|
||||
break;
|
||||
if (m_state != STATE_PENDING) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto item = m_queue.back();
|
||||
|
@ -159,7 +159,8 @@ void xmrig::RxQueue::backgroundInit()
|
|||
m_storage->init(item.seed, item.threads, item.hugePages);
|
||||
|
||||
lock = std::move(std::unique_lock<std::mutex>(m_mutex));
|
||||
if (!m_queue.empty()) {
|
||||
|
||||
if (m_state == STATE_SHUTDOWN || !m_queue.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue