There is no EndPtr anymore - reinterpret the original comment in terms
[oota-llvm.git] / include / llvm / Support / CrashRecoveryContext.h
index d44d24ac95ebac27e46bca9cc7e4d990bfd4dede..2e9b5d4aa541eaed4d86ca5dd556fc873c5ad478 100644 (file)
@@ -47,14 +47,16 @@ public:
   CrashRecoveryContext() : Impl(0) {}
   ~CrashRecoveryContext();
 
-  /// \brief Enable crash recovery. This function is not thread safe, clients
-  /// should call it during startup or with a lock held.
+  /// \brief Enable crash recovery.
   static void Enable();
 
-  /// \brief Disable crash recovery. This function is not thread safe, clients
-  /// should call it during startup or with a lock held.
+  /// \brief Disable crash recovery.
   static void Disable();
 
+  /// \brief Return the active context, if the code is currently executing in a
+  /// thread which is in a protected context.
+  static CrashRecoveryContext *GetCurrent();
+
   /// \brief Execute the provide callback function (with the given arguments) in
   /// a protected context.
   ///
@@ -65,6 +67,14 @@ public:
   /// the backtrace of the crash on failures.
   bool RunSafely(void (*Fn)(void*), void *UserData);
 
+  /// \brief Execute the provide callback function (with the given arguments) in
+  /// a protected context which is run in another thread (optionally with a
+  /// requested stack size).
+  ///
+  /// See RunSafely() and llvm_execute_on_thread().
+  bool RunSafelyOnThread(void (*Fn)(void*), void *UserData,
+                         unsigned RequestedStackSize = 0);
+
   /// \brief Explicitly trigger a crash recovery in the current process, and
   /// return failure from RunSafely(). This function does not return.
   void HandleCrash();