 
     deinit {
       #if os(Windows)
-        SetConsoleCtrlHandler(signalHandler, false)
+        SetConsoleCtrlHandler(self.signalHandler, false)
         CloseHandle(signalWatchingPipe[1])
       #else
         // Restore the old action and close the write end of pipe.
-        sigaction(SIGINT, &oldAction, nil)
-        close(signalWatchingPipe[1])
+        sigaction(SIGINT, &Self.oldAction, nil)
+        close(Self.signalWatchingPipe[1])
       #endif
         thread.join()
     }

                }
            }
          #if os(Windows)
            CloseHandle(signalWatchingPipe[0])
          #else
            close(signalWatchingPipe[0])
          #endif
        }
        thread.start()

import TSCLibc
import TSCBasic

/// This class can be used by command line tools to install a handler which
/// should be called when a interrupt signal is delivered to the process.
@available(*, deprecated, message: "use DispatchSource instead")
public final class InterruptHandler {
    /// Interrupt signal handling global variables
    private static var wasInterrupted = false
    private static var wasInterruptedLock = Lock()
    #if os(Windows)
    private static var signalWatchingPipe: [HANDLE] = [INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE]
    #else
    private static var signalWatchingPipe: [Int32] = [0, 0]
    private static var oldAction = sigaction()
    #endif

    /// The thread which waits to be notified when a signal is received.
    let thread: Thread
