[threading] Introduce the notion of try block to be used by recursive locks.
authorRodrigo Kumpera <kumpera@gmail.com>
Mon, 13 Apr 2015 22:36:46 +0000 (18:36 -0400)
committerRodrigo Kumpera <kumpera@gmail.com>
Mon, 13 Apr 2015 23:05:51 +0000 (19:05 -0400)
commitf4da7083e83a69cacc69c9977e059ab8b07311a8
tree0d032451687823a8792fb35ed0802b55da1c38b7
parent37e5a38d4c67565a5f29f8a9ca4ee5cc0a528de8
[threading] Introduce the notion of try block to be used by recursive locks.

This allows a piece of code to handle the cases where it's called in running and blocker context
and must always be in blocking context.

This probably makes code more modular at the expense of an easy to follow and debug execution model.

Since we don't currently annotate all icalls with blocking sections we do it with locks but they can
nest and recurse which requires this support for try block.
mono/utils/mono-threads-coop.c
mono/utils/mono-threads-coop.h
mono/utils/mono-threads-state-machine.c
mono/utils/mono-threads.h