Skip to content

Commit ada06d4

Browse files
committed
Sync il2cpp revision 3176daa483ca4da5a5b38f62018b80f7b511efea
1 parent 4e9c005 commit ada06d4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mono/mini/debugger-agent.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4178,7 +4178,11 @@ thread_startup (MonoProfiler *prof, uintptr_t tid)
41784178
tls = g_new0 (DebuggerTlsData, 1);
41794179
#endif
41804180
MONO_GC_REGISTER_ROOT_SINGLE (tls->thread, MONO_ROOT_SOURCE_DEBUGGER, NULL, "Debugger Thread Reference");
4181+
#ifdef RUNTIME_IL2CPP
4182+
il2cpp_gc_wbarrier_set_field(tls, (void**)&tls->thread, thread);
4183+
#else
41814184
tls->thread = thread;
4185+
#endif
41824186
mono_native_tls_set_value (debugger_tls_id, tls);
41834187

41844188
DEBUG_PRINTF (1, "[%p] Thread started, obj=%p, tls=%p.\n", (gpointer)tid, thread, tls);
@@ -4214,10 +4218,12 @@ thread_end (MonoProfiler *prof, uintptr_t tid)
42144218
/* Can't remove from tid_to_thread, as that would defeat the check in thread_start () */
42154219
#ifndef RUNTIME_IL2CPP
42164220
MONO_GC_UNREGISTER_ROOT (tls->thread);
4217-
#else
4218-
callbacks.il2cpp_debugger_free_thread_context(&tls->il2cpp_context);
42194221
#endif
4222+
#ifdef RUNTIME_IL2CPP
4223+
il2cpp_gc_wbarrier_set_field(tls, (void**)&tls->thread, NULL);
4224+
#else
42204225
tls->thread = NULL;
4226+
#endif
42214227
}
42224228
}
42234229
mono_loader_unlock ();

0 commit comments

Comments
 (0)