Browse Source

Zero all pthread_t identities upon cancelling threads.

Con Kolivas 14 years ago
parent
commit
13c40f753b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      util.c

+ 5 - 2
util.c

@@ -680,8 +680,11 @@ void thr_info_cancel(struct thr_info *thr)
 
 
 	if (thr->q)
 	if (thr->q)
 		tq_freeze(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)
 bool get_dondata(char **url, char **userpass)