better master threading

This commit is contained in:
roberto@goyle
2011-06-24 06:56:30 +02:00
parent 8d92261852
commit 283904107f
4 changed files with 17 additions and 13 deletions

View File

@@ -828,6 +828,13 @@ void uwsgi_python_init_apps() {
}
void uwsgi_python_master_fixup() {
if (uwsgi.has_threads) {
UWSGI_RELEASE_GIL;
}
}
void uwsgi_python_enable_threads() {
PyEval_InitThreads();
@@ -853,13 +860,6 @@ void uwsgi_python_enable_threads() {
}
void uwsgi_python_master_fixup() {
if (uwsgi.has_threads) {
UWSGI_RELEASE_GIL;
}
}
void uwsgi_python_init_thread(int core_id) {
// set a new ThreadState for each thread
@@ -1088,6 +1088,7 @@ struct uwsgi_plugin python_plugin = {
.init_apps = uwsgi_python_init_apps,
.fixup = uwsgi_python_fixup,
.master_fixup = uwsgi_python_master_fixup,
.mount_app = uwsgi_python_mount_app,
@@ -1095,8 +1096,6 @@ struct uwsgi_plugin python_plugin = {
.init_thread = uwsgi_python_init_thread,
.manage_xml = uwsgi_python_xml,
.master_fixup = uwsgi_python_master_fixup,
.magic = uwsgi_python_magic,
.suspend = uwsgi_python_suspend,