*
* Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
+ * Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
*/
#include <config.h>
#define SET_APPDOMAIN(x) do { \
MONO_FAST_TLS_SET (tls_appdomain,x); \
mono_native_tls_set_value (appdomain_thread_id, x); \
+ mono_gc_set_current_thread_appdomain (x); \
} while (FALSE)
#else /* !MONO_HAVE_FAST_TLS */
#define GET_APPDOMAIN() ((MonoDomain *)mono_native_tls_get_value (appdomain_thread_id))
-#define SET_APPDOMAIN(x) mono_native_tls_set_value (appdomain_thread_id, x);
+#define SET_APPDOMAIN(x) do { \
+ mono_native_tls_set_value (appdomain_thread_id, x); \
+ mono_gc_set_current_thread_appdomain (x); \
+ } while (FALSE)
#endif
{"v2.0.50727","2.0", { {2,0,0,0}, {8,0,0,0}, { 3, 5, 0, 0 } } },
{"v4.0.20506","4.0", { {4,0,0,0}, {10,0,0,0}, { 4, 0, 0, 0 } } },
{"v4.0.30128","4.0", { {4,0,0,0}, {10,0,0,0}, { 4, 0, 0, 0 } } },
- {"v4.0.30319","4.0", { {4,0,0,0}, {10,0,0,0}, { 4, 0, 0, 0 } } },
+ {"v4.0.30319","4.5", { {4,0,0,0}, {10,0,0,0}, { 4, 0, 0, 0 } } },
{"moonlight", "2.1", { {2,0,5,0}, {9,0,0,0}, { 3, 5, 0, 0 } } },
};
mono_gc_base_init ();
MONO_FAST_TLS_INIT (tls_appdomain);
- mono_native_tls_alloc (appdomain_thread_id, NULL);
+ mono_native_tls_alloc (&appdomain_thread_id, NULL);
InitializeCriticalSection (&appdomains_mutex);
{
int n;
int max = G_N_ELEMENTS (supported_runtimes);
- gboolean do_partial_match;
int vlen;
if (!version)
return NULL;
- vlen = strlen (version);
- if (vlen >= 4 && version [1] - '0' >= 4)
- do_partial_match = TRUE;
- else
- do_partial_match = FALSE;
-
for (n=0; n<max; n++) {
- if (do_partial_match && strncmp (version, supported_runtimes[n].runtime_version, 4) == 0)
- return &supported_runtimes[n];
if (strcmp (version, supported_runtimes[n].runtime_version) == 0)
return &supported_runtimes[n];
}
+
+ vlen = strlen (version);
+ if (vlen >= 4 && version [1] - '0' >= 4) {
+ for (n=0; n<max; n++) {
+ if (strncmp (version, supported_runtimes[n].runtime_version, 4) == 0)
+ return &supported_runtimes[n];
+ }
+ }
+
return NULL;
}