mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Overlap queued decrementing with staged incrementing.
This commit is contained in:
parent
9f1d9ce3b7
commit
5fadfdb219
13
cgminer.c
13
cgminer.c
@ -2427,7 +2427,7 @@ static void *get_work_thread(void *userdata)
|
||||
}
|
||||
fail_pause = opt_fail_pause;
|
||||
|
||||
dec_queued(pool);
|
||||
ret_work->queued = true;
|
||||
}
|
||||
|
||||
applog(LOG_DEBUG, "Pushing work to requesting thread");
|
||||
@ -2890,7 +2890,12 @@ static int tv_sort(struct work *worka, struct work *workb)
|
||||
|
||||
static bool hash_push(struct work *work)
|
||||
{
|
||||
bool rc = true;
|
||||
bool rc = true, dec = false;
|
||||
|
||||
if (work->queued) {
|
||||
work->queued = false;
|
||||
dec = true;
|
||||
}
|
||||
|
||||
mutex_lock(stgd_lock);
|
||||
if (likely(!getq->frozen)) {
|
||||
@ -2901,6 +2906,10 @@ static bool hash_push(struct work *work)
|
||||
rc = false;
|
||||
pthread_cond_signal(&getq->cond);
|
||||
mutex_unlock(stgd_lock);
|
||||
|
||||
if (dec)
|
||||
dec_queued(work->pool);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user