From 58897bf382d9c81e898624f0de7b5fdcd1a8eb8d Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 30 Jan 2012 22:18:29 +1100 Subject: [PATCH] Disable the correct threads on changing to/from dynamic mode. --- main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 19abed93..03d9b1d4 100644 --- a/main.c +++ b/main.c @@ -3579,11 +3579,15 @@ retry: static void pause_dynamic_threads(int gpu) { struct cgpu_info *cgpu = &gpus[gpu]; - int i; + int i, thread_no = 0; - for (i = 1; i < cgpu->threads; i++) { + for (i = 0; i < mining_threads; i++) { struct thr_info *thr = &thr_info[i]; + if (thr->cgpu != cgpu) + continue; + if (!thread_no++) + continue; thr->pause = cgpu->dynamic; if (!cgpu->dynamic) tq_push(thr->q, &ping);