mono/mono — pull request #865 by madewokherd (2014-01-06 19:00:16+00:00)
Title: Initialize icalls before exceptions.

Since the icall mutex was added (720c9f42c7a1d5b11b30c19232ab0b9b58cb10c1), I'm seeing hangs in mono_jit_init in my win32 build. What happens is that mini_init calls mono_exceptions_init, which calls mono_arch_exceptions_init, which on x86 adds some icalls, which grabs the icall mutex. However, the grab cannot work because mini_icall_init, which initializes the mutex, isn't called until after mono_exceptions_init.

From reading the icall_init code I can't see any reason why it would need exceptions to be initialized first, so I think we can swap the order of those two calls. But a review from someone more familiar with this code would be nice.