Skip to content

Commit

Permalink
Workaround until CI can switch to newer xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
janvorli committed Jun 5, 2024
1 parent 577027e commit 5ea3596
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/coreclr/pal/src/exception/signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,24 @@ BOOL SEHInitializeSignals(CorUnix::CPalThread *pthrCurrent, DWORD flags)
if (flags & PAL_INITIALIZE_REGISTER_ACTIVATION_SIGNAL)
{
#ifdef __APPLE__
if (__builtin_available(macOS 14.4, *))
void *libdispatch = dlopen("/usr/lib/system/libdispatch.dylib", RTLD_LAZY);
if (libdispatch != NULL)
{
// Allow sending the activation signal to dispatch queue threads
int st = dispatch_allow_send_signals(INJECT_ACTIVATION_SIGNAL);
g_canSendSignalToDispatchQueueThreads = (st == 0);
int (*dispatch_allow_send_signals_ptr)(int) = (int (*)(int))dlsym(libdispatch, "dispatch_allow_send_signals");
if (dispatch_allow_send_signals_ptr != NULL)
{
int st = dispatch_allow_send_signals_ptr(INJECT_ACTIVATION_SIGNAL);
g_canSendSignalToDispatchQueueThreads = (st == 0);
}
}

// TODO: Once our CI tools can get upgraded to xcode >= 15.4, replace the code above by this:
// if (__builtin_available(macOS 14.4, *))
// {
// // Allow sending the activation signal to dispatch queue threads
// int st = dispatch_allow_send_signals(INJECT_ACTIVATION_SIGNAL);
// g_canSendSignalToDispatchQueueThreads = (st == 0);
// }
#endif // __APPLE__

handle_signal(INJECT_ACTIVATION_SIGNAL, inject_activation_handler, &g_previous_activation);
Expand Down

0 comments on commit 5ea3596

Please sign in to comment.