From cbb0f8a26da7aca3c881a66ff891e49160035e37 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 22 Oct 2015 11:39:31 +0100 Subject: [PATCH] [threads] Print more information in case of error in global suspend --- mono/utils/mono-threads.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c index 1c1a1842eb2..6bfd46cc3ef 100644 --- a/mono/utils/mono-threads.c +++ b/mono/utils/mono-threads.c @@ -134,7 +134,9 @@ mono_threads_add_to_pending_operation_set (MonoThreadInfo* info) void mono_threads_begin_global_suspend (void) { - g_assert (pending_suspends == 0); + size_t ps = pending_suspends; + if (G_UNLIKELY (ps != 0)) + g_error ("pending_suspends = %d, but must be 0", ps); THREADS_SUSPEND_DEBUG ("------ BEGIN GLOBAL OP sp %d rp %d ap %d wd %d po %d (sp + rp + ap == wd) (wd == po)\n", suspend_posts, resume_posts, abort_posts, waits_done, pending_ops); g_assert ((suspend_posts + resume_posts + abort_posts) == waits_done); @@ -144,7 +146,9 @@ mono_threads_begin_global_suspend (void) void mono_threads_end_global_suspend (void) { - g_assert (pending_suspends == 0); + size_t ps = pending_suspends; + if (G_UNLIKELY (ps != 0)) + g_error ("pending_suspends = %d, but must be 0", ps); THREADS_SUSPEND_DEBUG ("------ END GLOBAL OP sp %d rp %d ap %d wd %d po %d\n", suspend_posts, resume_posts, abort_posts, waits_done, pending_ops); g_assert ((suspend_posts + resume_posts + abort_posts) == waits_done); -- 2.25.1