             fatalError("Run can be only called once")
         }
         if let timeout = _timeout {
-            switch CFRunLoopRunInMode(CFRunLoopMode.defaultMode, timeout, false) {
+#if os(Linux)
+            switch Int(CFRunLoopRunInMode(runLoopMode, timeout, false)) {
+            case kCFRunLoopRunFinished:
+                return
+            case kCFRunLoopRunHandledSource:
+                return
+            case kCFRunLoopRunStopped:
+                return
+            case kCFRunLoopRunTimedOut:
+                throw RxError.timeout
+            default:
+                fatalError("This failed because CFRunLoopRunResult wasn't bridged to Swift.")
+            }
+#else
+            switch CFRunLoopRunInMode(runLoopMode, timeout, false) {
             case .finished:
                 return
             case .handledSource:

            case .timedOut:
                throw RxError.timeout
            }
        }
        else {
            CFRunLoopRun()
        }
    }
}
#endif

        if AtomicIncrement(&_calledStop) != 1 {
            return
        }
        CFRunLoopPerformBlock(_currentRunLoop, runLoopMode) {
            CFRunLoopStop(self._currentRunLoop)
        }
        CFRunLoopWakeUp(_currentRunLoop)
