mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Provide a copy_work_noffset function for copying a work struct but changing its ntime.
This commit is contained in:
parent
e18ae1e222
commit
61297399de
@ -3618,12 +3618,14 @@ static void _copy_work(struct work *work, const struct work *base_work, int noff
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Generates a copy of an existing work struct, creating fresh heap allocations
|
/* Generates a copy of an existing work struct, creating fresh heap allocations
|
||||||
* for all dynamically allocated arrays within the struct */
|
* for all dynamically allocated arrays within the struct. noffset is used for
|
||||||
struct work *copy_work(struct work *base_work)
|
* when a driver has internally rolled the ntime, noffset is a relative value.
|
||||||
|
* The macro copy_work() calls this function with an noffset of 0. */
|
||||||
|
struct work *copy_work_noffset(struct work *base_work, int noffset)
|
||||||
{
|
{
|
||||||
struct work *work = make_work();
|
struct work *work = make_work();
|
||||||
|
|
||||||
_copy_work(work, base_work, 0);
|
_copy_work(work, base_work, noffset);
|
||||||
|
|
||||||
return work;
|
return work;
|
||||||
}
|
}
|
||||||
|
3
miner.h
3
miner.h
@ -1532,7 +1532,8 @@ extern void adl(void);
|
|||||||
extern void app_restart(void);
|
extern void app_restart(void);
|
||||||
extern void clean_work(struct work *work);
|
extern void clean_work(struct work *work);
|
||||||
extern void free_work(struct work *work);
|
extern void free_work(struct work *work);
|
||||||
extern struct work *copy_work(struct work *base_work);
|
extern struct work *copy_work_noffset(struct work *base_work, int noffset);
|
||||||
|
#define copy_work(work_in) copy_work_noffset(work_in, 0)
|
||||||
extern struct thr_info *get_thread(int thr_id);
|
extern struct thr_info *get_thread(int thr_id);
|
||||||
extern struct cgpu_info *get_devices(int id);
|
extern struct cgpu_info *get_devices(int id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user