anchor.diff:        let stdinReaderThread = 
           new Thread(new ThreadStart(fun () ->
               InstallErrorLoggingOnThisThread errorLogger // FSI error logging on stdinReaderThread, e.g. parse errors.
  -#if FX_LCIDFROMCODEPAGE
               use _scope = SetCurrentUICultureForThread fsiOptions.FsiLCID
  -#endif
               try 
                   try 
                     let initialTokenizer = fsiStdinLexerProvider.CreateStdinLexer(errorLogger)
  
positive.code:              posixReinstate()
               stdinInterruptState <- StdinEOFPermittedBecauseCtrlCRecentlyPressed
               killThreadRequest <- if (interruptAllowed = InterruptCanRaiseException) then ThreadAbortRequest else PrintInterruptRequest
  
  #endif
  
  //----------------------------------------------------------------------------
  // assembly finder
  
negative.code:     | ExitRequest 
      | PrintInterruptRequest
  
  type internal FsiInterruptController(fsiOptions: FsiCommandLineOptions, fsiConsoleOutput: FsiConsoleOutput) =
  
      let mutable stdinInterruptState = StdinNormal
      let CTRL_C = 0 
      let mutable interruptAllowed = InterruptIgnored
      let mutable killThreadRequest = NoRequest
  
      let mutable ctrlEventHandlers = []: ControlEventHandler list
      let mutable ctrlEventActions  = []: (unit -> unit) list
      let mutable exitViaKillThread = false
  
      let mutable posixReinstate = (fun () -> ())
  
      member __.Exit() =
          if exitViaKillThread then
              killThreadRequest <- ExitRequest
              Thread.Sleep(1000)
          exit 0
  
      member __.FsiInterruptStdinState
          with get () = stdinInterruptState
          and set v = stdinInterruptState <- v
  
      member __.ClearInterruptRequest() = killThreadRequest <- NoRequest
  
      member __.InterruptAllowed
          with set v = interruptAllowed <- v
  
      member __.Interrupt() = ctrlEventActions |> List.iter (fun act -> act())
  
      member __.EventHandlers = ctrlEventHandlers
  
      member controller.InstallKillThread(threadToKill:Thread, pauseMilliseconds:int) =
  
          // Fsi Interupt handler
          let raiseCtrlC() =
              use _scope = SetCurrentUICultureForThread fsiOptions.FsiLCID
              fprintf fsiConsoleOutput.Error "%s" (FSIstrings.SR.fsiInterrupt())
  
              stdinInterruptState <- StdinEOFPermittedBecauseCtrlCRecentlyPressed
              if (interruptAllowed = InterruptCanRaiseException) then 
                  killThreadRequest <- ThreadAbortRequest
                  let killerThread = 
                      new Thread(new ThreadStart(fun () ->
                          use _scope = SetCurrentUICultureForThread fsiOptions.FsiLCID
                          // sleep long enough to allow ControlEventHandler handler on main thread to return 
                          // Also sleep to give computations a bit of time to terminate 
                          Thread.Sleep(pauseMilliseconds)
                          if (killThreadRequest = ThreadAbortRequest) then 
                              if !progress then fsiConsoleOutput.uprintnfn "%s" (FSIstrings.SR.fsiAbortingMainThread())  
                              killThreadRequest <- NoRequest
                              threadToKill.Abort()
                          ()),Name="ControlCAbortThread") 
                  killerThread.IsBackground <- true
                  killerThread.Start()
  
          let fsiInterruptHandler (args:ConsoleCancelEventArgs) =
              args.Cancel <- true
              ctrlEventHandlers |> List.iter(fun handler -> handler.Invoke(CTRL_C) |> ignore)
  
          do Console.CancelKeyPress.Add(fsiInterruptHandler)
  
          // WINDOWS TECHNIQUE: .NET has more safe points, and you can do more when a safe point. 
          // Hence we actually start up the killer thread within the handler.
          let ctrlEventHandler = new ControlEventHandler(fun i ->  if i = CTRL_C then (raiseCtrlC(); true) else false ) 
          ctrlEventHandlers <- ctrlEventHandler :: ctrlEventHandlers
          ctrlEventActions  <- raiseCtrlC       :: ctrlEventActions
          exitViaKillThread <- false // don't exit via kill thread
  
      member x.PosixInvoke(n:int) = 
           // we run this code once with n = -1 to make sure it is JITted before execution begins
  