From 806765d1d3b8e1a26e290a3d3db93c87bda82934 Mon Sep 17 00:00:00 2001 From: "roberto@maverick64" Date: Thu, 3 Mar 2011 17:15:01 +0100 Subject: [PATCH] fixed python3.2 threads --- plugins/python/gil.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/python/gil.c b/plugins/python/gil.c index dfcd0d7f..be21b8f5 100644 --- a/plugins/python/gil.c +++ b/plugins/python/gil.c @@ -4,13 +4,20 @@ extern struct uwsgi_server uwsgi; extern struct uwsgi_python up; void gil_real_get() { + /* PyEval_AcquireLock(); PyThreadState_Swap((PyThreadState *) pthread_getspecific(up.upt_gil_key)); + */ + PyEval_RestoreThread((PyThreadState *) pthread_getspecific(up.upt_gil_key)); } void gil_real_release() { + /* pthread_setspecific(up.upt_gil_key, (void *) PyThreadState_Swap(NULL)); - PyEval_ReleaseLock(); + PyEval_ReleaseLock(); + */ + pthread_setspecific(up.upt_gil_key, (void *) PyThreadState_Get()); + PyEval_SaveThread(); } void gil_fake_get() {}