[iOS] Generate unique class name for MonoDeadLetter (#89956)
authorSteve Pfister <steveisok@users.noreply.github.com>
Tue, 8 Aug 2023 16:29:57 +0000 (09:29 -0700)
committerGitHub <noreply@github.com>
Tue, 8 Aug 2023 16:29:57 +0000 (12:29 -0400)
commitc09d381d875b220c04841d3dfce0c22d7466d837
tree6fdab43a4e70ec97e8b2b5278f83f42ea73453b7
parent9666832d94ebd3e84603ba82a8a94bfd722ea9db
[iOS] Generate unique class name for MonoDeadLetter (#89956)

In library mode, it is possible to have multiple shared libraries (runtimes) loaded in the same process. On iOS, we have a small bit of objc to make sure we know when threads die so we can properly detach the runtime. Unfortunately, the class name we use is not unique and results in a crash when calling into a 2nd library.

This change makes the class name partially unique to avoid such a circumstance.
src/mono/mono/utils/mono-threads-mach-helper.c
src/native/libs/System.Native/pal_autoreleasepool.m