Skip to content

Commit 0e2663d

Browse files
Josh Petersonjoncham
authored andcommitted
Don't attempt to stop threads on exit
With IL2CPP, we don't have a good way to stop managed threads. So let's just ignore that and exit the process. This won't clean up and run finalizers, but the process it ending anyway, so we don't care too much.
1 parent 44ce5b7 commit 0e2663d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mono/mini/debugger-agent.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8753,12 +8753,20 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
87538753

87548754
mono_environment_exitcode_set (exit_code);
87558755

8756+
/*
8757+
* We don't have a good way to suspend threads in IL2CPP, so just
8758+
* skip this code and call exit below. We will not shut down cleanly
8759+
* (e.g. run finalizers) but we don't care too much about that with
8760+
* IL2CPP.
8761+
*/
8762+
#ifndef RUNTIME_IL2CPP
87568763
/* Suspend all managed threads since the runtime is going away */
87578764
DEBUG_PRINTF (1, "Suspending all threads...\n");
87588765
mono_thread_suspend_all_other_threads ();
87598766
DEBUG_PRINTF (1, "Shutting down the runtime...\n");
87608767
mono_runtime_quit ();
87618768
transport_close2 ();
8769+
#endif
87628770
DEBUG_PRINTF (1, "Exiting...\n");
87638771

87648772
exit (exit_code);

0 commit comments

Comments
 (0)