Update outdated pods.
This commit is contained in:
4
Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift
generated
4
Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift
generated
@ -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 {
|
||||
|
12
Pods/RxSwift/RxSwift/Concurrency/Lock.swift
generated
12
Pods/RxSwift/RxSwift/Concurrency/Lock.swift
generated
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -6,8 +6,6 @@
|
||||
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol SynchronizedDisposeType : class, Disposable, Lock {
|
||||
func _synchronized_dispose()
|
||||
}
|
||||
|
@ -6,8 +6,6 @@
|
||||
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol SynchronizedOnType : class, ObserverType, Lock {
|
||||
func _synchronized_on(_ event: Event<E>)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -6,8 +6,6 @@
|
||||
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol SynchronizedUnsubscribeType : class {
|
||||
associatedtype DisposeKey
|
||||
|
||||
|
Reference in New Issue
Block a user