From 5637bb1f8d33e98319e3215c815abf81dcd392fe Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Tue, 14 Apr 2020 18:23:00 -0400 Subject: [PATCH] Make sampling_thread_running a global variable --- src/mono/mono/mini/mini-posix.c | 2 -- src/mono/mono/utils/mono-time.c | 4 +++- src/mono/mono/utils/mono-time.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/mini-posix.c b/src/mono/mono/mini/mini-posix.c index a0aa2ae..8441ede 100644 --- a/src/mono/mono/mini/mini-posix.c +++ b/src/mono/mono/mini/mini-posix.c @@ -514,8 +514,6 @@ mono_runtime_cleanup_handlers (void) #ifdef HAVE_PROFILER_SIGNAL -static volatile gint32 sampling_thread_running; - static int profiler_signal; static volatile gint32 sampling_thread_exiting; static MonoOSEvent sampling_thread_exited; diff --git a/src/mono/mono/utils/mono-time.c b/src/mono/mono/utils/mono-time.c index 040cb34..e1ff12f 100644 --- a/src/mono/mono/utils/mono-time.c +++ b/src/mono/mono/utils/mono-time.c @@ -235,6 +235,8 @@ mono_100ns_datetime_from_timeval (struct timeval tv) #endif +volatile gint32 sampling_thread_running; + #ifdef HOST_DARWIN static clock_serv_t sampling_clock_service; @@ -257,7 +259,7 @@ mono_clock_init_for_profiler (MonoProfilerSampleMode mode) { } -static void +void mono_clock_cleanup (void) { kern_return_t ret; diff --git a/src/mono/mono/utils/mono-time.h b/src/mono/mono/utils/mono-time.h index b7e4200..b5cd8b3 100644 --- a/src/mono/mono/utils/mono-time.h +++ b/src/mono/mono/utils/mono-time.h @@ -30,6 +30,7 @@ gint64 mono_100ns_datetime (void); gint64 mono_100ns_datetime_from_timeval (struct timeval tv); #endif +extern volatile gint32 sampling_thread_running; void mono_clock_init (void); void mono_clock_init_for_profiler (MonoProfilerSampleMode mode); void mono_clock_cleanup (void); -- 2.7.4