[sgen] Shutdown thread pool worker even if it's not active
[mono.git] / mono / sgen / sgen-thread-pool.c
index 6f164d278c1b7d9b9a075c3de72506c0d2ba021a..f2aef3ae02363d6ccb3d107fce8f8a7f39d38cbb 100644 (file)
@@ -108,7 +108,7 @@ thread_func (void *thread_data)
                gboolean do_idle;
                SgenThreadPoolJob *job;
 
-               if (!should_work (thread_data)) {
+               if (!should_work (thread_data) && !threadpool_shutdown) {
                        mono_os_cond_wait (&work_cond, &lock);
                        continue;
                }