Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r2923:9fe2a9e06094 Date: 2017-03-28 14:36 +0200 http://bitbucket.org/cffi/cffi/changeset/9fe2a9e06094/
Log: Pull request #79 by xwang We can actually call PyThreadState_Delete(), which works without the GIL and seems to pass the same tests. diff --git a/c/misc_thread_common.h b/c/misc_thread_common.h --- a/c/misc_thread_common.h +++ b/c/misc_thread_common.h @@ -29,12 +29,7 @@ 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); } _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit