2017
[folly.git] / folly / experimental / symbolizer / SignalHandler.h
index 2c13b1948407c165d48db2ec6cf90d995d398566..6b748207e4afa38908cd1f0d49d45ac271ed8fe6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,7 @@
  * limitations under the License.
  */
 
-#ifndef FOLLY_SYMBOLIZER_SIGNALHANDLER_H_
-#define FOLLY_SYMBOLIZER_SIGNALHANDLER_H_
+#pragma once
 
 #include <functional>
 
@@ -30,7 +29,6 @@ namespace folly { namespace symbolizer {
  */
 void installFatalSignalHandler();
 
-
 /**
  * Add a callback to be run when receiving a fatal signal. They will also
  * be called by LOG(FATAL) and abort() (as those raise SIGABRT internally).
@@ -39,12 +37,15 @@ void installFatalSignalHandler();
  * LOG(...) or printf or malloc / new or doing anything even remotely fun.
  *
  * All these fatal callback must be added before calling
- * installFatalSignalHandler().
+ * installFatalSignalCallbacks(), below.
  */
-void addFatalSignalCallback(std::function<void()> callback);
+typedef void (*SignalCallback)(void);
+void addFatalSignalCallback(SignalCallback callback);
 
+/**
+ * Install the fatal signal callbacks; fatal signals will call these
+ * callbacks in the order in which they were added.
+ */
+void installFatalSignalCallbacks();
 
 }}  // namespaces
-
-#endif /* FOLLY_SYMBOLIZER_SIGNALHANDLER_H_ */
-