Commit 09ee3c59a3dd67b9ef7377c12d2831310c7f682b

ckolivas 2014-07-10T11:33:35

Avoid blocking all pool testing if one pool fails to ever init

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/cgminer.c b/cgminer.c
index b0330b3..bf063eb 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -8227,10 +8227,11 @@ static void *watchpool_thread(void __maybe_unused *userdata)
 			if (pool->enabled == POOL_DISABLED)
 				continue;
 
-			/* Don't start testing any pools if the test threads
-			 * from startup are still doing their first attempt. */
+			/* Don't start testing a pool if its test thread
+			 * from startup is still doing its first attempt. */
 			if (unlikely(pool->testing)) {
-				pthread_join(pool->test_thread, NULL);
+				if (pthread_tryjoin_np(pool->test_thread, NULL))
+					continue;
 				pool->testing = false;
 			}