|
|
@ -3784,6 +3784,7 @@ out: |
|
|
|
static struct work *hash_pop(const struct timespec *abstime) |
|
|
|
static struct work *hash_pop(const struct timespec *abstime) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct work *work = NULL; |
|
|
|
struct work *work = NULL; |
|
|
|
|
|
|
|
bool queue = false; |
|
|
|
int rc = 0; |
|
|
|
int rc = 0; |
|
|
|
|
|
|
|
|
|
|
|
mutex_lock(stgd_lock); |
|
|
|
mutex_lock(stgd_lock); |
|
|
@ -3795,9 +3796,14 @@ static struct work *hash_pop(const struct timespec *abstime) |
|
|
|
HASH_DEL(staged_work, work); |
|
|
|
HASH_DEL(staged_work, work); |
|
|
|
if (work->clone) |
|
|
|
if (work->clone) |
|
|
|
--staged_extras; |
|
|
|
--staged_extras; |
|
|
|
|
|
|
|
if (HASH_COUNT(staged_work) < mining_threads) |
|
|
|
|
|
|
|
queue = true; |
|
|
|
} |
|
|
|
} |
|
|
|
mutex_unlock(stgd_lock); |
|
|
|
mutex_unlock(stgd_lock); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (queue) |
|
|
|
|
|
|
|
queue_request(NULL, false); |
|
|
|
|
|
|
|
|
|
|
|
return work; |
|
|
|
return work; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|