mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
Make hash_pop signal the work scheduler each time it waits on the conditional that it should look for more work.
This commit is contained in:
parent
efc605ffd3
commit
a077c9f9a4
@ -5923,6 +5923,7 @@ static struct work *hash_pop(void)
|
|||||||
cgtime(&now);
|
cgtime(&now);
|
||||||
then.tv_sec = now.tv_sec + 10;
|
then.tv_sec = now.tv_sec + 10;
|
||||||
then.tv_nsec = now.tv_usec * 1000;
|
then.tv_nsec = now.tv_usec * 1000;
|
||||||
|
pthread_cond_signal(&gws_cond);
|
||||||
rc = pthread_cond_timedwait(&getq->cond, stgd_lock, &then);
|
rc = pthread_cond_timedwait(&getq->cond, stgd_lock, &then);
|
||||||
/* Check again for !no_work as multiple threads may be
|
/* Check again for !no_work as multiple threads may be
|
||||||
* waiting on this condition and another may set the
|
* waiting on this condition and another may set the
|
||||||
@ -5931,8 +5932,10 @@ static struct work *hash_pop(void)
|
|||||||
no_work = true;
|
no_work = true;
|
||||||
applog(LOG_WARNING, "Waiting for work to be available from pools.");
|
applog(LOG_WARNING, "Waiting for work to be available from pools.");
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
|
pthread_cond_signal(&gws_cond);
|
||||||
pthread_cond_wait(&getq->cond, stgd_lock);
|
pthread_cond_wait(&getq->cond, stgd_lock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (no_work) {
|
if (no_work) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user