Update pod RxSwift, RxCocoa to 4.5.0

This commit is contained in:
Qiu Yuzhou
2019-09-10 14:30:51 +08:00
parent 075949cdcb
commit 72c643eab2
238 changed files with 9425 additions and 4826 deletions

View File

@ -10,34 +10,10 @@
import Darwin
import class Foundation.Thread
import func Foundation.OSAtomicCompareAndSwap32Barrier
import func Foundation.OSAtomicIncrement32Barrier
import func Foundation.OSAtomicDecrement32Barrier
import protocol Foundation.NSCopying
typealias AtomicInt = Int32
fileprivate func castToUInt32Pointer(_ pointer: UnsafeMutablePointer<Int32>) -> UnsafeMutablePointer<UInt32> {
let raw = UnsafeMutableRawPointer(pointer)
return raw.assumingMemoryBound(to: UInt32.self)
}
let AtomicCompareAndSwap = OSAtomicCompareAndSwap32Barrier
let AtomicIncrement = OSAtomicIncrement32Barrier
let AtomicDecrement = OSAtomicDecrement32Barrier
func AtomicOr(_ mask: UInt32, _ theValue : UnsafeMutablePointer<Int32>) -> Int32 {
return OSAtomicOr32OrigBarrier(mask, castToUInt32Pointer(theValue))
}
func AtomicFlagSet(_ mask: UInt32, _ theValue : UnsafeMutablePointer<Int32>) -> Bool {
// just used to create a barrier
OSAtomicXor32OrigBarrier(0, castToUInt32Pointer(theValue))
return (theValue.pointee & Int32(mask)) != 0
}
extension Thread {
static func setThreadLocalStorageValue<T: AnyObject>(_ value: T?, forKey key: NSCopying
) {
static func setThreadLocalStorageValue<T: AnyObject>(_ value: T?, forKey key: NSCopying) {
let currentThread = Thread.current
let threadDictionary = currentThread.threadDictionary
@ -47,8 +23,8 @@
else {
threadDictionary[key] = nil
}
}
static func getThreadLocalStorageValueForKey<T>(_ key: NSCopying) -> T? {
let currentThread = Thread.current
let threadDictionary = currentThread.threadDictionary
@ -57,10 +33,4 @@
}
}
extension AtomicInt {
func valueSnapshot() -> Int32 {
return self
}
}
#endif