mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-03 20:21:41 +00:00
fixed python2.x threads
This commit is contained in:
@@ -4,20 +4,22 @@ extern struct uwsgi_server uwsgi;
|
||||
extern struct uwsgi_python up;
|
||||
|
||||
void gil_real_get() {
|
||||
/*
|
||||
#ifndef PYTHREE
|
||||
PyEval_AcquireLock();
|
||||
PyThreadState_Swap((PyThreadState *) pthread_getspecific(up.upt_gil_key));
|
||||
*/
|
||||
#else
|
||||
PyEval_RestoreThread((PyThreadState *) pthread_getspecific(up.upt_gil_key));
|
||||
#endif
|
||||
}
|
||||
|
||||
void gil_real_release() {
|
||||
/*
|
||||
#ifndef PYTHREE
|
||||
pthread_setspecific(up.upt_gil_key, (void *) PyThreadState_Swap(NULL));
|
||||
PyEval_ReleaseLock();
|
||||
*/
|
||||
#else
|
||||
pthread_setspecific(up.upt_gil_key, (void *) PyThreadState_Get());
|
||||
PyEval_SaveThread();
|
||||
#endif
|
||||
}
|
||||
|
||||
void gil_fake_get() {}
|
||||
|
||||
Reference in New Issue
Block a user