Commit d80e0ef4cef197493e2a0df6241a6e225afd3b13

Kano 2011-12-24T10:45:45

Cleanup API thread if it exits early

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/main.c b/main.c
index fab46ef..3a9865a 100644
--- a/main.c
+++ b/main.c
@@ -3770,10 +3770,14 @@ static void *workio_thread(void *userdata)
 
 static void *api_thread(void *userdata)
 {
+	struct thr_info *mythr = userdata;
+
 	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
 	api();
 
+	mythr->pth = 0L;
+
 	return NULL;
 }