mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Keep the unique id of each work item across copy_work to prevent multiple work items having the same id.
This commit is contained in:
parent
5f8d53b84a
commit
775a1abc06
@ -2939,8 +2939,13 @@ static void roll_work(struct work *work)
|
|||||||
* prevent a copied work struct from freeing ram belonging to another struct */
|
* prevent a copied work struct from freeing ram belonging to another struct */
|
||||||
void __copy_work(struct work *work, struct work *base_work)
|
void __copy_work(struct work *work, struct work *base_work)
|
||||||
{
|
{
|
||||||
|
int id = work->id;
|
||||||
|
|
||||||
clean_work(work);
|
clean_work(work);
|
||||||
memcpy(work, base_work, sizeof(struct work));
|
memcpy(work, base_work, sizeof(struct work));
|
||||||
|
/* Keep the unique new id assigned during make_work to prevent copied
|
||||||
|
* work from having the same id. */
|
||||||
|
work->id = id;
|
||||||
if (base_work->job_id)
|
if (base_work->job_id)
|
||||||
work->job_id = strdup(base_work->job_id);
|
work->job_id = strdup(base_work->job_id);
|
||||||
if (base_work->nonce2)
|
if (base_work->nonce2)
|
||||||
|
Loading…
Reference in New Issue
Block a user