Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Kumpera <kumpera@gmail.com>2018-05-25 20:39:30 +0300
committerMarek Safar <marek.safar@gmail.com>2018-06-14 16:02:19 +0300
commitf59eac4c0f142c55814be14ae8667d8511171017 (patch)
treec0b7ba41c2de08c2a4018ecf121f4d26370c648d
parenta37e6e5739cc2e2d2f2f2b671aca4e171e3318ba (diff)
[profiler] Don't raise events until the profiler transitions to the ready state. Fixes #8866.mono-5.12.0.273
We can't raise event before that as the profiler depends on too much runtime infrastructure at this point for it to reliably work. For example, we need the threading infrastructure to be init'd so we can access the thread-local profiler state to store events there.
-rw-r--r--mono/metadata/profiler.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mono/metadata/profiler.c b/mono/metadata/profiler.c
index c1850434cc4..db4c08b6b4c 100644
--- a/mono/metadata/profiler.c
+++ b/mono/metadata/profiler.c
@@ -894,6 +894,7 @@ update_callback (volatile gpointer *location, gpointer new_, volatile gint32 *co
void \
mono_profiler_raise_ ## name params \
{ \
+ if (!mono_profiler_state.startup_done) return; \
for (MonoProfilerHandle h = mono_profiler_state.profilers; h; h = h->next) { \
MonoProfiler ## type ## Callback cb = h->name ## _cb; \
if (cb) \