forked from OSchip/llvm-project
Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup
stuff. llvm-svn: 103333
This commit is contained in:
parent
d43f08d06e
commit
68272566c6
|
@ -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.
|
||||
|
|
|
@ -152,7 +152,9 @@ static RETSIGTYPE SignalHandler(int Sig) {
|
|||
CallBacksToRun[i].first(CallBacksToRun[i].second);
|
||||
}
|
||||
|
||||
|
||||
void llvm::sys::RunInterruptHandlers() {
|
||||
SignalHandler(SIGINT);
|
||||
}
|
||||
|
||||
void llvm::sys::SetInterruptFunction(void (*IF)()) {
|
||||
SignalsMutex.acquire();
|
||||
|
|
|
@ -189,6 +189,10 @@ static void Cleanup() {
|
|||
LeaveCriticalSection(&CriticalSection);
|
||||
}
|
||||
|
||||
void llvm::sys::RunInterruptHandlers() {
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
|
||||
try {
|
||||
Cleanup();
|
||||
|
|
Loading…
Reference in New Issue