Skip to content

Commit dc5f82b

Browse files
Josh Petersonjoncham
authored andcommitted
Don't shutdown in mono_runtime_try_shutdown
The Mono implementation of mono_runtime_try_shutdown does not actually shut down the VM. Instead, it sets the flags to indicate the VM is shutting down. The VM should actually shutdown in mono_runtime_quit. In some cases, we see this code path taken when processing the CMD_VM_EXIT command. This seems unlikely, but can happen when the code above cannot find a suspended managed thread. If mono_runtime_try_shutdown actually waits for managed threads to complete, it will hang, as the main thread won't be suspended because resume_vm is called just above mono_runtime_try_shutdown. So for IL2CPP mono_runtime_try_shutdown doesn't do anything, but mono_runtime_quit will actually shutdown the VM.
1 parent 0bd828b commit dc5f82b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mono/mini/il2cpp-stubs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ void il2cpp_mono_runtime_quit (void)
361361
{
362362
#if UNITY_TINY
363363
IL2CPP_ASSERT(0 && "Not implemented yet for tiny");
364+
return 0;
364365
#else
365366
il2cpp::vm::Runtime::Shutdown();
366367
#endif

0 commit comments

Comments
 (0)