1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-30 16:34:23 +00:00

make sure reinit_device cannot happen while algo switching, which would probably result in segfault

This commit is contained in:
Jan Berdajs 2014-06-05 18:40:27 +02:00
parent e58cd00db7
commit f0e47ec8ec

View File

@ -7272,7 +7272,9 @@ static void *longpoll_thread(void __maybe_unused *userdata)
void reinit_device(struct cgpu_info *cgpu) void reinit_device(struct cgpu_info *cgpu)
{ {
mutex_lock(&algo_switch_lock);
cgpu->drv->reinit_device(cgpu); cgpu->drv->reinit_device(cgpu);
mutex_unlock(&algo_switch_lock);
} }
static struct timeval rotate_tv; static struct timeval rotate_tv;