Skip to content

Commit

Permalink
Wrap mono_gc_init_finalizer_thread() call with now-needed coop GC sta…
Browse files Browse the repository at this point in the history
…te transition. (xamarin#8248)

Starting with mono/mono#16907 , the Mono runtime ends in GC-Safe state (mode) after mono_jit_init_version() is called. The monotouch code did not expect that, and calls mono_gc_init_finalizer_thread() which also tries to enter GC-safe mode.

Should fix mono/mono#19372

Co-authored-by: Alexis Christoforides <alexis@thenull.net>
  • Loading branch information
monojenkins and alexischr committed Mar 31, 2020
1 parent aa73e41 commit 3e4fd79
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/monotouch-main.m
Expand Up @@ -203,7 +203,9 @@ - (void) start
{
// COOP: ?
#if defined (__arm__) || defined(__aarch64__)
MONO_ENTER_GC_UNSAFE;
mono_gc_init_finalizer_thread ();
MONO_EXIT_GC_UNSAFE;
#endif
}

Expand Down

0 comments on commit 3e4fd79

Please sign in to comment.