1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Join threads to close hashfast driver.

This commit is contained in:
Con Kolivas 2013-10-14 00:28:57 +11:00
parent 598b58c8ce
commit 3c7af2e634

View File

@ -397,6 +397,10 @@ static bool hashfast_prepare(struct thr_info*thr)
quit(1, "Failed to pthread_create read thr in hashfast_prepare"); quit(1, "Failed to pthread_create read thr in hashfast_prepare");
if (pthread_create(&info->write_thr, NULL, hf_write, (void *)hashfast)) if (pthread_create(&info->write_thr, NULL, hf_write, (void *)hashfast))
quit(1, "Failed to pthread_create write thr in hashfast_prepare"); quit(1, "Failed to pthread_create write thr in hashfast_prepare");
cgtime(&now);
get_datestamp(hashfast->init, sizeof(hashfast->init), &now);
return true; return true;
} }
@ -415,8 +419,13 @@ static void hashfast_init(struct cgpu_info *hashfast)
usb_buffer_enable(hashfast); usb_buffer_enable(hashfast);
} }
static void hashfast_shutdown(struct thr_info __maybe_unused *thr) static void hashfast_shutdown(struct thr_info *thr)
{ {
struct cgpu_info *hashfast = thr->cgpu;
struct hashfast_info *info = hashfast->device_data;
pthread_join(info->read_thr, NULL);
pthread_join(info->write_thr, NULL);
} }
struct device_drv hashfast_drv = { struct device_drv hashfast_drv = {