Commit 1d27c119b6c8696cf9979e6a9674db51d1979e50

Con Kolivas 2011-07-18T22:02:10

Don't let total_queued go below zero.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/main.c b/main.c
index ab686d0..8556c15 100644
--- a/main.c
+++ b/main.c
@@ -1191,7 +1191,8 @@ static void inc_queued(void)
 static void dec_queued(void)
 {
 	pthread_mutex_lock(&qd_lock);
-	total_queued--;
+	if (total_queued > 0)
+		total_queued--;
 	pthread_mutex_unlock(&qd_lock);
 	dec_staged(1);
 }