diff --git a/runtime/exports.t4 b/runtime/exports.t4 index 336f850fd95c..885cf9ba42c1 100644 --- a/runtime/exports.t4 +++ b/runtime/exports.t4 @@ -255,6 +255,7 @@ "MonoProfileThreadFunc", "end" ) { XamarinRuntime = RuntimeMode.MonoVM, + Mode = DotNetMode.OnlyLegacy, }, new Export ("void", "mono_profiler_install_gc", diff --git a/runtime/monovm-bridge.m b/runtime/monovm-bridge.m index 961c748e6d7d..904dae8acfe6 100644 --- a/runtime/monovm-bridge.m +++ b/runtime/monovm-bridge.m @@ -235,6 +235,7 @@ * and create a pool that spans the thread's entire lifetime. */ +#if !DOTNET static CFMutableDictionaryRef xamarin_thread_hash = NULL; static pthread_mutex_t thread_hash_lock = PTHREAD_MUTEX_INITIALIZER; @@ -296,14 +297,18 @@ // COOP: no managed memory access: any mode. xamarin_thread_finish (NULL); } +#endif // !DOTNET void xamarin_install_nsautoreleasepool_hooks () { + // No need to do anything here for CoreCLR. +#if !DOTNET // COOP: executed at startup (and no managed memory access): any mode. xamarin_thread_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, NULL); mono_profiler_install_thread (thread_start, thread_end); +#endif // !DOTNET } void