 
     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()
     }


    /// Start watching for interrupt signal and call the handler whenever the signal is received.
    public init(_ handler: @escaping () -> Void) throws {
        // Create a signal handler.
        signalHandler = { _ in
            // Turn on the interrupt bool.
            wasInterruptedLock.withLock {
                wasInterrupted = true
            }
            // Write on pipe to notify the watching thread.
            var byte: UInt8 = 0
          #if os(Windows)
            var bytesWritten: DWORD = 0
            WriteFile(signalWatchingPipe[1], &byte, 1, &bytesWritten, nil)
            return true
          #else
            write(signalWatchingPipe[1], &byte, 1)
          #endif
        }
      #if os(Windows)

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