From 3779a70dcc295cba22a89d800a800164421573aa Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Thu, 14 Oct 2010 16:48:02 -0400 Subject: [PATCH] [ThreadPool] Clear the thread state Clear the thread state after finishing a work item. We were only resetting the background state. --- mono/metadata/threadpool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mono/metadata/threadpool.c b/mono/metadata/threadpool.c index 2420c3d7a10..d5d975829dd 100644 --- a/mono/metadata/threadpool.c +++ b/mono/metadata/threadpool.c @@ -1879,6 +1879,7 @@ async_invoke_thread (gpointer data) mono_thread_pop_appdomain_ref (); InterlockedDecrement (&tp->busy_threads); /* If the callee changes the background status, set it back to TRUE */ + mono_thread_clr_state (thread , ~ThreadState_Background); if (!mono_thread_test_state (thread , ThreadState_Background)) ves_icall_System_Threading_Thread_SetState (thread, ThreadState_Background); } -- GitLab