Commit 77cc5b4c6d840c8ff778339dcf0998d56550e4d0

Con Kolivas 2014-07-17T15:04:46

Remove the use of the pthread_tryjoin_np which is currently unimplemented on many platforms

diff --git a/cgminer.c b/cgminer.c
index 6c56195..c44892d 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -8281,11 +8281,8 @@ static void *watchpool_thread(void __maybe_unused *userdata)
 
 			/* Don't start testing a pool if its test thread
 			 * from startup is still doing its first attempt. */
-			if (unlikely(pool->testing)) {
-				if (pthread_tryjoin_np(pool->test_thread, NULL))
-					continue;
-				pool->testing = false;
-			}
+			if (unlikely(pool->testing))
+				continue;
 
 			/* Test pool is idle once every minute */
 			if (pool->idle && now.tv_sec - pool->tv_idle.tv_sec > 30) {
@@ -8661,6 +8658,7 @@ static void *test_pool_thread(void *arg)
 {
 	struct pool *pool = (struct pool *)arg;
 
+	pthread_detach(pthread_self());
 retry:
 	if (pool_active(pool, false)) {
 		pool_tset(pool, &pool->lagging);
@@ -8687,6 +8685,8 @@ retry:
 		goto retry;
 	}
 
+	pool->testing = false;
+
 	return NULL;
 }