Update outdated pods.

This commit is contained in:
Qiu Yuzhou
2017-03-20 21:26:25 +08:00
parent 5f97493f1d
commit 975b544078
209 changed files with 4395 additions and 2293 deletions

View File

@ -6,8 +6,6 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
/**
In case nobody holds this lock, the work will be queued and executed immediately
on thread that is requesting lock.
@ -18,7 +16,7 @@ and pending work.
That means that enqueued work could possibly be executed later on a different thread.
*/
class AsyncLock<I: InvocableType>
final class AsyncLock<I: InvocableType>
: Disposable
, Lock
, SynchronizedDisposeType {

View File

@ -6,31 +6,29 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
protocol Lock {
func lock()
func unlock()
}
// https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html
typealias SpinLock = NSRecursiveLock
typealias SpinLock = RecursiveLock
extension NSRecursiveLock : Lock {
extension RecursiveLock : Lock {
@inline(__always)
func performLocked(_ action: () -> Void) {
final func performLocked(_ action: () -> Void) {
lock(); defer { unlock() }
action()
}
@inline(__always)
func calculateLocked<T>(_ action: () -> T) -> T {
final func calculateLocked<T>(_ action: () -> T) -> T {
lock(); defer { unlock() }
return action()
}
@inline(__always)
func calculateLockedOrFail<T>(_ action: () throws -> T) throws -> T {
final func calculateLockedOrFail<T>(_ action: () throws -> T) throws -> T {
lock(); defer { unlock() }
let result = try action()
return result

View File

@ -6,10 +6,8 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
protocol LockOwnerType : class, Lock {
var _lock: NSRecursiveLock { get }
var _lock: RecursiveLock { get }
}
extension LockOwnerType {

View File

@ -6,8 +6,6 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
protocol SynchronizedDisposeType : class, Disposable, Lock {
func _synchronized_dispose()
}

View File

@ -6,8 +6,6 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
protocol SynchronizedOnType : class, ObserverType, Lock {
func _synchronized_on(_ event: Event<E>)
}

View File

@ -6,8 +6,6 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
protocol SynchronizedSubscribeType : class, ObservableType, Lock {
func _synchronized_subscribe<O: ObserverType>(_ observer: O) -> Disposable where O.E == E
}

View File

@ -6,8 +6,6 @@
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
protocol SynchronizedUnsubscribeType : class {
associatedtype DisposeKey