mirror of
https://github.com/GOSTSec/sgminer
synced 2025-09-08 04:02:08 +00:00
avalon init write_sem before use
This commit is contained in:
parent
f7e6701058
commit
b1f57595bd
@ -709,9 +709,11 @@ static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found
|
|||||||
if (!add_cgpu(avalon))
|
if (!add_cgpu(avalon))
|
||||||
goto unshin;
|
goto unshin;
|
||||||
|
|
||||||
|
cgsem_init(&info->write_sem);
|
||||||
|
|
||||||
ret = avalon_reset(avalon, true);
|
ret = avalon_reset(avalon, true);
|
||||||
if (ret && !configured)
|
if (ret && !configured)
|
||||||
goto unshin;
|
goto unshinsem;
|
||||||
|
|
||||||
update_usb_stats(avalon);
|
update_usb_stats(avalon);
|
||||||
|
|
||||||
@ -735,6 +737,10 @@ static bool avalon_detect_one(libusb_device *dev, struct usb_find_devices *found
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
unshinsem:
|
||||||
|
|
||||||
|
cgsem_destroy(&info->write_sem);
|
||||||
|
|
||||||
unshin:
|
unshin:
|
||||||
|
|
||||||
usb_uninit(avalon);
|
usb_uninit(avalon);
|
||||||
@ -1079,7 +1085,6 @@ static bool avalon_prepare(struct thr_info *thr)
|
|||||||
mutex_init(&info->qlock);
|
mutex_init(&info->qlock);
|
||||||
if (unlikely(pthread_cond_init(&info->qcond, NULL)))
|
if (unlikely(pthread_cond_init(&info->qcond, NULL)))
|
||||||
quit(1, "Failed to pthread_cond_init avalon qcond");
|
quit(1, "Failed to pthread_cond_init avalon qcond");
|
||||||
cgsem_init(&info->write_sem);
|
|
||||||
|
|
||||||
if (pthread_create(&info->read_thr, NULL, avalon_get_results, (void *)avalon))
|
if (pthread_create(&info->read_thr, NULL, avalon_get_results, (void *)avalon))
|
||||||
quit(1, "Failed to create avalon read_thr");
|
quit(1, "Failed to create avalon read_thr");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user