From 1592e1e3dae827bcfa301d234f7316ab0c9f975f Mon Sep 17 00:00:00 2001 From: Vlad Brezae Date: Thu, 16 Mar 2017 01:15:58 +0200 Subject: [PATCH] [runtime] Fix interruption deferring We were accidentally clearing the interruption deferred flag when exiting from nested abort protected regions. --- mono/metadata/threads.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 6831de89632..e31e0bbd4e8 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -282,8 +282,11 @@ mono_threads_end_abort_protected_block (void) int new_val = ((old_state & ABORT_PROT_BLOCK_MASK) >> ABORT_PROT_BLOCK_SHIFT) - 1; new_state = 0; - if ((old_state & INTERRUPT_REQUEST_DEFERRED_BIT) && new_val == 0) { - new_state |= INTERRUPT_REQUESTED_BIT; + if (old_state & INTERRUPT_REQUEST_DEFERRED_BIT) { + if (new_val == 0) + new_state |= INTERRUPT_REQUESTED_BIT; + else + new_state |= INTERRUPT_REQUEST_DEFERRED_BIT; } //bounds check abort_prot_count -- 2.11.4.GIT