[ThreadPool] Clear the thread state
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 14 Oct 2010 20:48:02 +0000 (16:48 -0400)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Thu, 14 Oct 2010 20:49:10 +0000 (16:49 -0400)
Clear the thread state after finishing a work item. We were only
resetting the background state.

mono/metadata/threadpool.c

index 13d6d331753bb0b09b39519e927b2430d4018fa2..1c7edcefb0001e9c65e1978c4f3fe43ec989121e 100644 (file)
@@ -2022,6 +2022,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);
                        }