Remove hashfast write thread for all writes can be done from scanwork without added complexity.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 130377f..7d2f3fe 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -368,20 +368,8 @@ static void *hf_read(void *arg)
struct hashfast_info *info = hashfast->device_data;
while (likely(!hashfast->shutdown)) {
-
}
- return NULL;
-}
-static void *hf_write(void *arg)
-{
- struct thr_info *thr = (struct thr_info *)arg;
- struct cgpu_info *hashfast = thr->cgpu;
- struct hashfast_info *info = hashfast->device_data;
-
- while (likely(!hashfast->shutdown)) {
-
- }
return NULL;
}
@@ -392,13 +380,8 @@ static bool hashfast_prepare(struct thr_info *thr)
struct timeval now;
mutex_init(&info->lock);
- mutex_init(&info->write_mutex);
- if (pthread_cond_init(&info->write_cond, NULL))
- quit(1, "Failed to pthread_cond_init in hashfast_prepare");
if (pthread_create(&info->read_thr, NULL, hf_read, (void *)thr))
quit(1, "Failed to pthread_create read thr in hashfast_prepare");
- if (pthread_create(&info->write_thr, NULL, hf_write, (void *)thr))
- quit(1, "Failed to pthread_create write thr in hashfast_prepare");
cgtime(&now);
get_datestamp(hashfast->init, sizeof(hashfast->init), &now);
@@ -427,7 +410,6 @@ static void hashfast_shutdown(struct thr_info *thr)
struct hashfast_info *info = hashfast->device_data;
pthread_join(info->read_thr, NULL);
- pthread_join(info->write_thr, NULL);
}
struct device_drv hashfast_drv = {
diff --git a/driver-hashfast.h b/driver-hashfast.h
index 9e7a0cd..47d108d 100644
--- a/driver-hashfast.h
+++ b/driver-hashfast.h
@@ -51,9 +51,6 @@ struct hashfast_info {
uint16_t hash_sequence_tail; // Follows device_sequence_tail around to free work
pthread_t read_thr;
- pthread_t write_thr;
- pthread_mutex_t write_mutex;
- pthread_cond_t write_cond;
};
#endif /* USE_HASHFAST */