Signal-safe.
| 72 | |
| 73 | // Signal-safe. |
| 74 | static void insertSignalHandler(sys::SignalHandlerCallback FnPtr, |
| 75 | void *Cookie) { |
| 76 | for (size_t I = 0; I < MaxSignalHandlerCallbacks; ++I) { |
| 77 | auto &SetMe = CallBacksToRun[I]; |
| 78 | auto Expected = CallbackAndCookie::Status::Empty; |
| 79 | auto Desired = CallbackAndCookie::Status::Initializing; |
| 80 | if (!SetMe.Flag.compare_exchange_strong(Expected, Desired)) |
| 81 | continue; |
| 82 | SetMe.Callback = FnPtr; |
| 83 | SetMe.Cookie = Cookie; |
| 84 | SetMe.Flag.store(CallbackAndCookie::Status::Initialized); |
| 85 | return; |
| 86 | } |
| 87 | report_fatal_error("too many signal callbacks already registered"); |
| 88 | } |
| 89 | |
| 90 | static bool findModulesAndOffsets(void **StackTrace, int Depth, |
| 91 | const char **Modules, intptr_t *Offsets, |
nothing calls this directly
no test coverage detected