mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-10 04:31:03 +00:00
Stage work outside of the stgd lock to prevent attempted recursive locking in clone_available.
This commit is contained in:
parent
34879487fc
commit
93e3c16aa8
@ -3000,7 +3000,7 @@ static void stage_work(struct work *work);
|
||||
|
||||
static bool clone_available(void)
|
||||
{
|
||||
struct work *work, *tmp;
|
||||
struct work *work_clone = NULL, *work, *tmp;
|
||||
bool cloned = false;
|
||||
|
||||
mutex_lock(stgd_lock);
|
||||
@ -3009,13 +3009,10 @@ static bool clone_available(void)
|
||||
|
||||
HASH_ITER(hh, staged_work, work, tmp) {
|
||||
if (can_roll(work) && should_roll(work)) {
|
||||
struct work *work_clone;
|
||||
|
||||
roll_work(work);
|
||||
work_clone = make_clone(work);
|
||||
roll_work(work);
|
||||
applog(LOG_DEBUG, "Pushing cloned available work to stage thread");
|
||||
stage_work(work_clone);
|
||||
cloned = true;
|
||||
break;
|
||||
}
|
||||
@ -3024,6 +3021,8 @@ static bool clone_available(void)
|
||||
out_unlock:
|
||||
mutex_unlock(stgd_lock);
|
||||
|
||||
if (cloned)
|
||||
stage_work(work_clone);
|
||||
return cloned;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user