* Author:
* Paolo Molaro (lupus@ximian.com)
*
- * (C) 2001-2003 Ximian, Inc.
- * (C) 2003-2006 Novell, Inc.
+ * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
+ * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
*/
#include "config.h"
static MonoProfileGCFunc gc_event;
static MonoProfileGCResizeFunc gc_heap_resize;
+static MonoProfileFunc runtime_initialized_event;
+
#define mono_profiler_coverage_lock() EnterCriticalSection (&profiler_coverage_mutex)
#define mono_profiler_coverage_unlock() LeaveCriticalSection (&profiler_coverage_mutex)
static CRITICAL_SECTION profiler_coverage_mutex;
gc_heap_resize = heap_resize_callback;
}
+void
+mono_profiler_install_runtime_initialized (MonoProfileFunc runtime_initialized_callback)
+{
+ runtime_initialized_event = runtime_initialized_callback;
+}
+
+void
+mono_profiler_runtime_initialized (void) {
+ if (runtime_initialized_event)
+ runtime_initialized_event (current_profiler);
+}
+
+
static GHashTable *coverage_hash = NULL;
MonoProfileCoverageInfo*
GSList *tmp;
char *str;
gint32 see_shutdown_done;
-
+
+#ifndef PLATFORM_WIN32
+ mono_thread_attach(mono_get_root_domain());
+#endif
+
// Make sure we execute simple_shutdown only once
see_shutdown_done = InterlockedExchange(& simple_shutdown_done, TRUE);
if (see_shutdown_done)