mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-05-01 04:13:36 +00:00
better master threading
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user