From d80e0ef4cef197493e2a0df6241a6e225afd3b13 Mon Sep 17 00:00:00 2001 From: Kano Date: Sat, 24 Dec 2011 10:45:45 +1100 Subject: [PATCH] Cleanup API thread if it exits early --- main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index fab46ef6..3a9865ad 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; }