The offsets-tool.py uses some magic to map `typename` to `<underscore>typename` for looking up runtime types.
This caused issues on netcore because we aliased it to a different name.
To fix this let's keep the `_MonoInternalThread` name instead and just fix the one location where `_MonoThread` is used.
Commit migrated from https://github.com/mono/mono/commit/
450d4746849d228c85748d9ab4ef68f90ac0c7f2
#if defined(MONO_CROSS_COMPILE)
/* Can't read the corlib version because we only have the target class layouts */
return NULL;
-#endif
-
+#else
char *result = NULL;
char *version = mono_get_corlib_version ();
if (!version) {
exit:
g_free (version);
return result;
+#endif
}
/**
mono_gstring_append_thread_name (GString*, MonoInternalThread*);
-#ifdef ENABLE_NETCORE
/*
- * There is only one thread object, MonoInternalThread is aliased to MonoThread,
+ * NETCORE: There is only one thread object,
* thread->internal_thread points to itself.
*/
-struct _MonoThread {
-#else
struct _MonoInternalThread {
-#endif
// FIXME: Mechanize keeping this in sync with managed.
MonoObject obj;
volatile int lock_thread_id; /* to be used as the pre-shifted thread id in thin locks. Used for appdomain_ref push/pop */
gsize thread_state;
#ifdef ENABLE_NETCORE
- struct _MonoThread *internal_thread;
+ struct _MonoInternalThread *internal_thread;
MonoObject *start_obj;
MonoException *pending_exception;
#else
gpointer last;
};
-#ifdef ENABLE_NETCORE
-#define _MonoInternalThread _MonoThread
-#else
+#ifndef ENABLE_NETCORE
struct _MonoThread {
MonoObject obj;
MonoInternalThread *internal_thread;
typedef struct _MonoReflectionType MONO_RT_MANAGED_ATTR MonoReflectionType;
typedef struct _MonoDelegate MONO_RT_MANAGED_ATTR MonoDelegate;
typedef struct _MonoThreadsSync MonoThreadsSync;
+#ifdef ENABLE_NETCORE
+typedef struct _MonoInternalThread MONO_RT_MANAGED_ATTR MonoThread;
+#else
typedef struct _MonoThread MONO_RT_MANAGED_ATTR MonoThread;
+#endif
typedef struct _MonoDynamicAssembly MonoDynamicAssembly;
typedef struct _MonoDynamicImage MonoDynamicImage;
typedef struct _MonoReflectionMethodBody MONO_RT_MANAGED_ATTR MonoReflectionMethodBody;
mono_runtime_cleanup (domain);
#endif
+#ifndef ENABLE_NETCORE
mono_threadpool_cleanup ();
+#endif
MONO_PROFILER_RAISE (runtime_shutdown_end, ());
typedef struct MonoJitTlsData MonoJitTlsData;
typedef struct MonoLMF MonoLMF;
typedef struct MonoTrampInfo MonoTrampInfo;
-#ifdef ENABLE_NETCORE
-typedef struct _MonoThread MonoInternalThread;
-#else
typedef struct _MonoInternalThread MonoInternalThread;
-#endif
typedef struct _SgenThreadInfo SgenThreadInfo;
#endif