mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 18:14:20 +00:00
Properly pthread_join miner threads on shutdown.
This commit is contained in:
parent
3a2008ac61
commit
ecd03cefb7
@ -2804,10 +2804,14 @@ static void __kill_work(void)
|
|||||||
applog(LOG_DEBUG, "Killing off mining threads");
|
applog(LOG_DEBUG, "Killing off mining threads");
|
||||||
/* Kill the mining threads*/
|
/* Kill the mining threads*/
|
||||||
for (i = 0; i < mining_threads; i++) {
|
for (i = 0; i < mining_threads; i++) {
|
||||||
|
pthread_t *pth = NULL;
|
||||||
|
|
||||||
thr = get_thread(i);
|
thr = get_thread(i);
|
||||||
|
if (thr && PTH(thr) != 0L)
|
||||||
|
pth = &thr->pth;
|
||||||
thr_info_cancel(thr);
|
thr_info_cancel(thr);
|
||||||
if (thr && thr->pth)
|
if (pth)
|
||||||
pthread_join(thr->pth, NULL);
|
pthread_join(*pth, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
applog(LOG_DEBUG, "Killing off stage thread");
|
applog(LOG_DEBUG, "Killing off stage thread");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user