[llvm-commits] [llvm] r103333 - in /llvm/trunk: include/llvm/System/Signals.h lib/System/Unix/Signals.inc lib/System/Win32/Signals.inc
Daniel Dunbar
daniel at zuster.org
Fri May 7 19:10:34 PDT 2010
Author: ddunbar
Date: Fri May 7 21:10:34 2010
New Revision: 103333
URL: http://llvm.org/viewvc/llvm-project?rev=103333&view=rev
Log:
Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup
stuff.
Modified:
llvm/trunk/include/llvm/System/Signals.h
llvm/trunk/lib/System/Unix/Signals.inc
llvm/trunk/lib/System/Win32/Signals.inc
Modified: llvm/trunk/include/llvm/System/Signals.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/System/Signals.h?rev=103333&r1=103332&r2=103333&view=diff
==============================================================================
--- llvm/trunk/include/llvm/System/Signals.h (original)
+++ llvm/trunk/include/llvm/System/Signals.h Fri May 7 21:10:34 2010
@@ -20,6 +20,10 @@
namespace llvm {
namespace sys {
+ /// This function runs all the registered interrupt handlers, including the
+ /// removal of files registered by RemoveFileOnSignal.
+ void RunInterruptHandlers();
+
/// This function registers signal handlers to ensure that if a signal gets
/// delivered that the named file is removed.
/// @brief Remove a file if a fatal signal occurs.
Modified: llvm/trunk/lib/System/Unix/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=103333&r1=103332&r2=103333&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Signals.inc (original)
+++ llvm/trunk/lib/System/Unix/Signals.inc Fri May 7 21:10:34 2010
@@ -152,7 +152,9 @@
CallBacksToRun[i].first(CallBacksToRun[i].second);
}
-
+void llvm::sys::RunInterruptHandlers() {
+ SignalHandler(SIGINT);
+}
void llvm::sys::SetInterruptFunction(void (*IF)()) {
SignalsMutex.acquire();
Modified: llvm/trunk/lib/System/Win32/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Signals.inc?rev=103333&r1=103332&r2=103333&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Signals.inc (original)
+++ llvm/trunk/lib/System/Win32/Signals.inc Fri May 7 21:10:34 2010
@@ -189,6 +189,10 @@
LeaveCriticalSection(&CriticalSection);
}
+void llvm::sys::RunInterruptHandlers() {
+ Cleanup();
+}
+
static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
try {
Cleanup();
More information about the llvm-commits
mailing list