Initial set of Ward sgen annotations (#5705)
[mono.git] / mono / metadata / sgen-mono.c
index ac977c0e5902e4133b05074a7edab4b20680a20a..4fc0e362d4eb90558c06f8c9f575e4128189c66a 100644 (file)
@@ -593,7 +593,7 @@ typedef struct {
 static EphemeronLinkNode *ephemeron_list;
 
 /* LOCKING: requires that the GC lock is held */
-static void
+static MONO_PERMIT (need (sgen_gc_locked)) void
 null_ephemerons_for_domain (MonoDomain *domain)
 {
        EphemeronLinkNode *current = ephemeron_list, *prev = NULL;
@@ -2261,8 +2261,7 @@ sgen_client_thread_detach_with_lock (SgenThreadInfo *p)
 
        tid = mono_thread_info_get_tid (p);
 
-       if (p->client_info.info.runtime_thread)
-               mono_threads_add_joinable_thread ((gpointer)tid);
+       mono_threads_add_joinable_runtime_thread (&p->client_info.info);
 
        if (mono_gc_get_gc_callbacks ()->thread_detach_func) {
                mono_gc_get_gc_callbacks ()->thread_detach_func (p->client_info.runtime_data);
@@ -2362,6 +2361,10 @@ sgen_client_scan_thread_data (void *start_nursery, void *end_nursery, gboolean p
 {
        scan_area_arg_start = start_nursery;
        scan_area_arg_end = end_nursery;
+#ifdef HOST_WASM
+       //Under WASM we don't scan thread stacks and we can't trust the values we find there either.
+       return;
+#endif
 
        FOREACH_THREAD (info) {
                int skip_reason = 0;