mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 01:44:23 +00:00
core: remove second-to-last remnants of hotplug.
If you grep hotplug, you'll find two more occurences as a function argument, but it's unused.
This commit is contained in:
parent
e32dcd7190
commit
ecfd497467
2
miner.h
2
miner.h
@ -1071,8 +1071,6 @@ extern bool add_pool_details(struct pool *pool, bool live, char *url, char *user
|
|||||||
#define MAX_RAWINTENSITY 2147483647
|
#define MAX_RAWINTENSITY 2147483647
|
||||||
#define MAX_RAWINTENSITY_STR "2147483647"
|
#define MAX_RAWINTENSITY_STR "2147483647"
|
||||||
|
|
||||||
extern bool hotplug_mode;
|
|
||||||
extern int hotplug_time;
|
|
||||||
extern struct list_head scan_devices;
|
extern struct list_head scan_devices;
|
||||||
extern int nDevs;
|
extern int nDevs;
|
||||||
extern int hw_errors;
|
extern int hw_errors;
|
||||||
|
23
sgminer.c
23
sgminer.c
@ -175,10 +175,6 @@ static int input_thr_id;
|
|||||||
int gpur_thr_id;
|
int gpur_thr_id;
|
||||||
static int api_thr_id;
|
static int api_thr_id;
|
||||||
static int total_control_threads;
|
static int total_control_threads;
|
||||||
bool hotplug_mode;
|
|
||||||
static int new_devices;
|
|
||||||
static int new_threads;
|
|
||||||
int hotplug_time = 5;
|
|
||||||
|
|
||||||
#if LOCK_TRACKING
|
#if LOCK_TRACKING
|
||||||
pthread_mutex_t lockstat_lock;
|
pthread_mutex_t lockstat_lock;
|
||||||
@ -7842,17 +7838,11 @@ void enable_device(struct cgpu_info *cgpu)
|
|||||||
devices[cgpu->sgminer_id = sgminer_id_count++] = cgpu;
|
devices[cgpu->sgminer_id = sgminer_id_count++] = cgpu;
|
||||||
wr_unlock(&devices_lock);
|
wr_unlock(&devices_lock);
|
||||||
|
|
||||||
if (hotplug_mode) {
|
mining_threads += cgpu->threads;
|
||||||
new_threads += cgpu->threads;
|
|
||||||
#ifdef HAVE_CURSES
|
#ifdef HAVE_CURSES
|
||||||
adj_width(mining_threads + new_threads, &dev_width);
|
adj_width(mining_threads, &dev_width);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
|
||||||
mining_threads += cgpu->threads;
|
|
||||||
#ifdef HAVE_CURSES
|
|
||||||
adj_width(mining_threads, &dev_width);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (cgpu->drv->drv_id == DRIVER_opencl) {
|
if (cgpu->drv->drv_id == DRIVER_opencl) {
|
||||||
gpu_threads += cgpu->threads;
|
gpu_threads += cgpu->threads;
|
||||||
}
|
}
|
||||||
@ -7888,17 +7878,14 @@ bool add_cgpu(struct cgpu_info *cgpu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wr_lock(&devices_lock);
|
wr_lock(&devices_lock);
|
||||||
devices = (struct cgpu_info **)realloc(devices, sizeof(struct cgpu_info *) * (total_devices + new_devices + 2));
|
devices = (struct cgpu_info **)realloc(devices, sizeof(struct cgpu_info *) * (total_devices + 2));
|
||||||
wr_unlock(&devices_lock);
|
wr_unlock(&devices_lock);
|
||||||
|
|
||||||
mutex_lock(&stats_lock);
|
mutex_lock(&stats_lock);
|
||||||
cgpu->last_device_valid_work = time(NULL);
|
cgpu->last_device_valid_work = time(NULL);
|
||||||
mutex_unlock(&stats_lock);
|
mutex_unlock(&stats_lock);
|
||||||
|
|
||||||
if (hotplug_mode)
|
devices[total_devices++] = cgpu;
|
||||||
devices[total_devices + new_devices++] = cgpu;
|
|
||||||
else
|
|
||||||
devices[total_devices++] = cgpu;
|
|
||||||
|
|
||||||
adjust_mostdevs();
|
adjust_mostdevs();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user