You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4b771e8
Browse filesBrowse the repository at this point in the historyBrowse files
Before, the SignalCatcherRegistry just used the std::atomic pointer to remove SignalCatcherImpls, which could get the wrong SignalCatcherImpl if a SignalCatcher registered multiple SignalCatcherImpls (since they all had the same std::atomic pointer). This wasn't an issue in practice since all SignalCatcherImpls are deregistered at the same time, so it got all of them, but it still wasn't how the code was intended to work. Now, SignalCatcherRegistry uses the SignalCatcherImpl pointer, which is the actual intention.
// - when registering the signal handler fails, the registerer will be destroyed, unregistering the signal_occurred_flag,
@@ -212,7 +204,12 @@ class SignalCatcherImpl final {
212
204
// Allow only the set of signals that is supported on all platforms, see for Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=vs-2017
213
205
ASSERT(signal == SIGABRT || signal == SIGFPE || signal == SIGILL || signal == SIGINT || signal == SIGSEGV || signal == SIGTERM, "Unknown signal");
214
206
}
207
+
208
+
voidsetSignalOccurred() {
209
+
*_signal_occurred_flag = true;
210
+
}
215
211
private:
212
+
std::atomic<bool>* _signal_occurred_flag;
216
213
SignalCatcherRegisterer _registerer;
217
214
SignalHandlerRAII _handler;
218
215
@@ -221,6 +218,16 @@ class SignalCatcherImpl final {
221
218
222
219
}
223
220
221
+
namespace {
222
+
voidgot_signal(int signal) {
223
+
#if defined(_MSC_VER)
224
+
// Only needed on Windows, Linux does this by default. See comment on SignalHandlerRunningRAII class.
0 commit comments