MCPcopy Create free account
hub / github.com/apache/trafficserver / FatalConditionHandler

Class FatalConditionHandler

lib/catch2/catch.hpp:8011–8035  ·  view source on GitHub ↗

Wrapper for platform-specific fatal error (signals/SEH) handlers Tries to be cooperative with other handlers, and not step over other handlers. This means that unknown structured exceptions are passed on, previous signal handlers are called, and so on. Can only be instantiated once, and assumes that once a signal is caught, the binary will end up terminating. Thus, there

Source from the content-addressed store, hash-verified

8009 // Can only be instantiated once, and assumes that once a signal
8010 // is caught, the binary will end up terminating. Thus, there
8011 class FatalConditionHandler {
8012 bool m_started = false;
8013
8014 // Install/disengage implementation for specific platform.
8015 // Should be if-defed to work on current platform, can assume
8016 // engage-disengage 1:1 pairing.
8017 void engage_platform();
8018 void disengage_platform();
8019 public:
8020 // Should also have platform-specific implementations as needed
8021 FatalConditionHandler();
8022 ~FatalConditionHandler();
8023
8024 void engage() {
8025 assert(!m_started && "Handler cannot be installed twice.");
8026 m_started = true;
8027 engage_platform();
8028 }
8029
8030 void disengage() {
8031 assert(m_started && "Handler cannot be uninstalled without being installed first");
8032 m_started = false;
8033 disengage_platform();
8034 }
8035 };
8036
8037 //! Simple RAII guard for (dis)engaging the FatalConditionHandler
8038 class FatalConditionHandlerGuard {

Callers 1

catch.hppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected