0001    import Foundation
0002    
0003    public class Echo
Echo.swift:5
    static let instance = Echo()
Echo.swift:45
        Echo.instance.begin()
Echo.swift:49
        Echo.instance.begin()
Echo.swift:53
        Echo.instance.exit()
{ 0004 0005 static let instance
Echo.swift:45
        Echo.instance.begin()
Echo.swift:49
        Echo.instance.begin()
Echo.swift:53
        Echo.instance.exit()
= Echo() 0006 0007 private var running
Echo.swift:18
        if !running {
Echo.swift:19
            running = true
Echo.swift:29
            } while (running && isRunning)
Echo.swift:36
        if running {
Echo.swift:37
            running = false
= false 0008 0009 let mainQueue
Echo.swift:13
        mainQueue = MainQueue(identifier:"com.queue.main")
: MainQueue 0010 let globalQueue
Echo.swift:14
        globalQueue = ConcurrentQueue(identifier: "com.queue.global")
: ConcurrentQueue 0011 0012 private init
Echo.swift:5
    static let instance = Echo()
() { 0013 mainQueue = MainQueue(identifier:"com.queue.main") 0014 globalQueue = ConcurrentQueue(identifier: "com.queue.global") 0015 } 0016 0017 func begin
Echo.swift:45
        Echo.instance.begin()
Echo.swift:49
        Echo.instance.begin()
() { 0018 if !running { 0019 running = true 0020 #if os(Linux) 0021 mainQueue.run() 0022 #else 0023 let resolution = 1.0; 0024 var isRunning: Bool = false 0025 repeat { 0026 let next = NSDate(timeIntervalSinceNow: resolution) 0027 isRunning = NSRunLoop.mainRunLoop() 0028 .runMode(NSDefaultRunLoopMode, beforeDate: next) 0029 } while (running && isRunning) 0030 #endif 0031 0032 } 0033 } 0034 0035 func exit
Echo.swift:53
        Echo.instance.exit()
() { 0036 if running { 0037 running = false 0038 #if os(Linux) 0039 mainQueue.exit() 0040 #endif 0041 } 0042 } 0043 0044 public class func begin() { 0045 Echo.instance.begin() 0046 } 0047 0048 public class func beginEventLoop() { 0049 Echo.instance.begin() 0050 } 0051 0052 public class func exit() { 0053 Echo.instance.exit() 0054 } 0055 } 0056