Commit 0d8b8793b5482cd14ee8abef1fc0b23f619fbbf5

Con Kolivas 2011-07-19T17:00:56

Reset the queued count to allow more work to be queued for the new pool on pool switch.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/main.c b/main.c
index 10a92b9..a2674a9 100644
--- a/main.c
+++ b/main.c
@@ -271,6 +271,11 @@ static void switch_pools(void)
 	gettimeofday(&currentpool->tv_localgen, NULL);
 	applog(LOG_WARNING, "Prolonged outage. Attempting to switch to %s", currentpool->rpc_url);
 	pthread_mutex_unlock(&control_lock);
+
+	/* Reset the queued amount to allow more to be queued for the new pool */
+	pthread_mutex_lock(&qd_lock);
+	total_queued = 0;
+	pthread_mutex_unlock(&qd_lock);
 }
 
 /* FIXME: Use asprintf for better errors. */