提交 ae4b6d59 编写于 作者: T Tak

[SDB] Fix race-to-crash on runtime shutdown.

 * debugger-agent.c: Fix race-to-crash on runtime shutdown.

License: MIT/X11
上级 070b1086
......@@ -6939,16 +6939,18 @@ debugger_thread (void *arg)
mono_set_is_debugger_attached (FALSE);
mono_mutex_lock (&debugger_thread_exited_mutex);
debugger_thread_exited = TRUE;
mono_cond_signal (&debugger_thread_exited_cond);
mono_mutex_unlock (&debugger_thread_exited_mutex);
if (! (vm_death_event_sent || mono_runtime_is_shutting_down ())) {
mono_mutex_lock (&debugger_thread_exited_mutex);
debugger_thread_exited = TRUE;
mono_cond_signal (&debugger_thread_exited_cond);
mono_mutex_unlock (&debugger_thread_exited_mutex);
DEBUG (1, printf ("[dbg] Debugger thread exited.\n"));
if (command_set == CMD_SET_VM && command == CMD_VM_DISPOSE && !vm_death_event_sent && !mono_runtime_is_shutting_down ()) {
DEBUG (2, fprintf (log_file, "[dbg] Detached - restarting clean debugger thread.\n"));
start_debugger_thread ();
DEBUG (1, printf ("[dbg] Debugger thread exited.\n"));
if (command_set == CMD_SET_VM && command == CMD_VM_DISPOSE) {
DEBUG (2, fprintf (log_file, "[dbg] Detached - restarting clean debugger thread.\n"));
start_debugger_thread ();
}
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册