another series (the last i hope) of threading fixes

This commit is contained in:
roberto@debian32
2011-06-25 09:36:59 +02:00
parent e6914b91e1
commit a05f5d9860
4 changed files with 25 additions and 12 deletions
+13 -2
View File
@@ -830,12 +830,23 @@ void uwsgi_python_init_apps() {
void uwsgi_python_master_fixup(int step) {
static int master_fixed = 0;
static int worker_fixed = 0;
if (!uwsgi.master_process) return;
if (uwsgi.has_threads) {
if (step == 0) {
UWSGI_RELEASE_GIL;
if (!master_fixed) {
UWSGI_RELEASE_GIL;
master_fixed = 1;
}
}
else {
UWSGI_GET_GIL;
if (!worker_fixed) {
UWSGI_GET_GIL;
worker_fixed = 1;
}
}
}
}