Allow bridge callbacks to be set after GC init
authorAndi McClure <andi.mcclure@xamarin.com>
Tue, 12 Jul 2016 22:31:58 +0000 (18:31 -0400)
committerAndi McClure <andi.mcclure@xamarin.com>
Tue, 12 Jul 2016 22:31:58 +0000 (18:31 -0400)
commit7114fd4236240973a58180739a897231d50920fb
tree32930f0672d8d77beae9151a5293bc7b3abf6945
parenta11bcf50f900501086ae07676d3702dd4cec17c1
Allow bridge callbacks to be set after GC init

This is cleanup to the previous emergency fix for bug 42469. The goal of that fix was to defer bridge processor initialization until after sgen init, but it introduced a requirement mono_gc_register_bridge_callback be called before sgen init. This breaks Xamarin Designer, which sets up callbacks late.

This patch introduces an sgen_init_bridge () which is called both at startup and after callbacks are set, and performs the initialization once all pieces are in place. Additional concurrency and style issues are also addressed.
mono/metadata/sgen-bridge-internals.h
mono/metadata/sgen-bridge.c
mono/metadata/sgen-bridge.h
mono/sgen/sgen-gc.c
mono/sgen/sgen-gc.h