mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 22:14:36 +00:00
Don't start testing any pools with the watchpool thread if any of the test threads are still active.
This commit is contained in:
parent
7e3ca57049
commit
e0196a3307
11
cgminer.c
11
cgminer.c
@ -6135,6 +6135,13 @@ static void *watchpool_thread(void __maybe_unused *userdata)
|
|||||||
if (pool->enabled == POOL_DISABLED)
|
if (pool->enabled == POOL_DISABLED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Don't start testing any pools if the test threads
|
||||||
|
* from startup are still doing their first attempt. */
|
||||||
|
if (unlikely(pool->testing)) {
|
||||||
|
pthread_join(pool->test_thread, NULL);
|
||||||
|
pool->testing = false;
|
||||||
|
}
|
||||||
|
|
||||||
/* Test pool is idle once every minute */
|
/* Test pool is idle once every minute */
|
||||||
if (pool->idle && now.tv_sec - pool->tv_idle.tv_sec > 30) {
|
if (pool->idle && now.tv_sec - pool->tv_idle.tv_sec > 30) {
|
||||||
gettimeofday(&pool->tv_idle, NULL);
|
gettimeofday(&pool->tv_idle, NULL);
|
||||||
@ -6991,10 +6998,10 @@ static void probe_pools(void)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < total_pools; i++) {
|
for (i = 0; i < total_pools; i++) {
|
||||||
pthread_t *test_thread = malloc(sizeof(pthread_t));
|
|
||||||
struct pool *pool = pools[i];
|
struct pool *pool = pools[i];
|
||||||
|
|
||||||
pthread_create(test_thread, NULL, test_pool_thread, (void *)pool);
|
pool->testing = true;
|
||||||
|
pthread_create(&pool->test_thread, NULL, test_pool_thread, (void *)pool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user