We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad9bbce commit 54dc3b5Copy full SHA for 54dc3b5
Modules/_threadmodule.c
@@ -82,6 +82,15 @@ module_threads_reinit(struct module_threads *threads)
82
static void
83
module_threads_fini(struct module_threads *threads)
84
{
85
+ // Wait for all the threads to finalize.
86
+ PyThread_acquire_lock(threads->mutex, WAIT_LOCK);
87
+ while (threads->head != NULL) {
88
+ PyThread_release_lock(threads->mutex);
89
+ // XXX Sleep?
90
91
+ }
92
93
+
94
PyThread_free_lock(threads->mutex);
95
}
96
0 commit comments