[runtime] Fix missing abort during abort protected regions
authorVlad Brezae <brezaevlad@gmail.com>
Fri, 17 Mar 2017 20:41:04 +0000 (22:41 +0200)
committerVlad Brezae <brezaevlad@gmail.com>
Wed, 22 Mar 2017 23:40:13 +0000 (01:40 +0200)
commitdba2b07309c3bd91707280408140dbdbe17c9cb5
tree05e9cb9c48b7aa00b16bfc944adac7ea1632e4d6
parent786cbe76a82cc31f8047765be974701b754d2cde
[runtime] Fix missing abort during abort protected regions

When aborting a thread we set the thread's interruption request and we also increment the global interruption request. If we were trying to abort a thread when it is in an abort protected region, it will just set an interruption deferred and not do anything else (in async_abort_critical). When the thread exited the abort protected region, it was missing the abort request since we didn't increment the global interruption request.

Refactor thread_interruption_requested modifications, making sure we always bump it when requesting an interruption and decrease it when we clear an interruption.
mono/metadata/threads.c