summaryrefslogtreecommitdiff
path: root/c/misc_thread_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/misc_thread_common.h')
-rw-r--r--c/misc_thread_common.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/c/misc_thread_common.h b/c/misc_thread_common.h
index 1ddf619..d232e7e 100644
--- a/c/misc_thread_common.h
+++ b/c/misc_thread_common.h
@@ -29,12 +29,7 @@ static void cffi_thread_shutdown(void *p)
struct cffi_tls_s *tls = (struct cffi_tls_s *)p;
if (tls->local_thread_state != NULL) {
- /* We need to re-acquire the GIL temporarily to free the
- thread state. I hope it is not a problem to do it in
- a thread-local destructor.
- */
- PyEval_RestoreThread(tls->local_thread_state);
- PyThreadState_DeleteCurrent();
+ PyThreadState_Delete(tls->local_thread_state);
}
free(tls);
}