Commit 13c40f753b7cd08b9861943ac661f81f16bcfad7

Con Kolivas 2011-12-25T00:06:25

Zero all pthread_t identities upon cancelling threads.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/util.c b/util.c
index 54bb80c..0ad8b7d 100644
--- a/util.c
+++ b/util.c
@@ -680,8 +680,11 @@ void thr_info_cancel(struct thr_info *thr)
 
 	if (thr->q)
 		tq_freeze(thr->q);
-	if (pthread_cancel(thr->pth))
-		pthread_join(thr->pth, NULL);
+	if (thr->pth) {
+			if (pthread_cancel(thr->pth))
+				pthread_join(thr->pth, NULL);
+			thr->pth = 0L;
+	}
 }
 
 bool get_dondata(char **url, char **userpass)