Skip to content

Commit

Permalink
fixed python3.2 threads
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto@maverick64 committed Mar 3, 2011
1 parent 62d2b97 commit 806765d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/python/gil.c
Expand Up @@ -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() {}
Expand Down

0 comments on commit 806765d

Please sign in to comment.