1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup

stuff.

llvm-svn: 103333
This commit is contained in:
Daniel Dunbar 2010-05-08 02:10:34 +00:00
parent 4ca74b9c6c
commit 1457d51ff8
3 changed files with 11 additions and 1 deletions

View File

@ -20,6 +20,10 @@
namespace llvm { namespace llvm {
namespace sys { 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 /// This function registers signal handlers to ensure that if a signal gets
/// delivered that the named file is removed. /// delivered that the named file is removed.
/// @brief Remove a file if a fatal signal occurs. /// @brief Remove a file if a fatal signal occurs.

View File

@ -152,7 +152,9 @@ static RETSIGTYPE SignalHandler(int Sig) {
CallBacksToRun[i].first(CallBacksToRun[i].second); CallBacksToRun[i].first(CallBacksToRun[i].second);
} }
void llvm::sys::RunInterruptHandlers() {
SignalHandler(SIGINT);
}
void llvm::sys::SetInterruptFunction(void (*IF)()) { void llvm::sys::SetInterruptFunction(void (*IF)()) {
SignalsMutex.acquire(); SignalsMutex.acquire();

View File

@ -189,6 +189,10 @@ static void Cleanup() {
LeaveCriticalSection(&CriticalSection); LeaveCriticalSection(&CriticalSection);
} }
void llvm::sys::RunInterruptHandlers() {
Cleanup();
}
static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) { static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
try { try {
Cleanup(); Cleanup();