[llvm-commits] CVS: llvm/lib/System/Win32/Signals.inc

Jeff Cohen jeffc at jolt-lang.org
Mon Aug 1 20:26:43 PDT 2005



Changes in directory llvm/lib/System/Win32:

Signals.inc updated: 1.18 -> 1.19
---
Log message:

It's dangerous coding on Mondays.

---
Diffs of the changes:  (+5 -8)

 Signals.inc |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)


Index: llvm/lib/System/Win32/Signals.inc
diff -u llvm/lib/System/Win32/Signals.inc:1.18 llvm/lib/System/Win32/Signals.inc:1.19
--- llvm/lib/System/Win32/Signals.inc:1.18	Mon Aug  1 22:04:47 2005
+++ llvm/lib/System/Win32/Signals.inc	Mon Aug  1 22:26:32 2005
@@ -114,8 +114,8 @@
 
 
 void sys::SetInterruptFunction(void (*IF)()) {
-  InterruptFunction = IF;
   RegisterHandler();
+  InterruptFunction = IF;
   LeaveCriticalSection(&CriticalSection);
 }
 }
@@ -239,6 +239,7 @@
 }
 
 static BOOL WINAPI LLVMConsoleCtrlHandler(DWORD dwCtrlType) {
+  // We are running in our very own thread, courtesy of Windows.
   EnterCriticalSection(&CriticalSection);
   Cleanup();
 
@@ -248,13 +249,9 @@
   InterruptFunction = 0;      // Don't run it on another CTRL-C.
 
   if (IF) {
-    try {
-      IF();                   // Run it now.
-    } catch (...) {
-      // Kill the process on an exception.
-      LeaveCriticalSection(&CriticalSection);
-      return FALSE;
-    }
+    // Note: if the interrupt function throws an exception, there is nothing
+    // to catch it in this thread so it will kill the process.
+    IF();                     // Run it now.
     LeaveCriticalSection(&CriticalSection);
     return TRUE;              // Don't kill the process.
   }






More information about the llvm-commits mailing list