| 114 | |
| 115 | template <typename F> |
| 116 | void SCrashHandler::handleFunction(F&& f, CrashTerminateCode code) |
| 117 | { |
| 118 | beforeHandlingSignal(code); |
| 119 | |
| 120 | auto& this_ = *skr_crash_handler_get(); |
| 121 | // Acquire lock to avoid other threads (if exist) to crash while we are inside. |
| 122 | this_.crashLock(); |
| 123 | f(); |
| 124 | // Terminate process |
| 125 | if (!kContinue) |
| 126 | { |
| 127 | this_.terminateProcess(code); |
| 128 | } |
| 129 | // Free lock |
| 130 | this_.crashUnlock(); |
| 131 | } |
| 132 | #endif |
no test coverage detected