Update outdated pods.
This commit is contained in:
23
Pods/RxSwift/Platform/Platform.Darwin.swift
generated
23
Pods/RxSwift/Platform/Platform.Darwin.swift
generated
@ -9,17 +9,34 @@
|
||||
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
|
||||
|
||||
import Darwin
|
||||
import Foundation
|
||||
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: String
|
||||
static func setThreadLocalStorageValue<T: AnyObject>(_ value: T?, forKey key: NSCopying
|
||||
) {
|
||||
let currentThread = Thread.current
|
||||
let threadDictionary = currentThread.threadDictionary
|
||||
@ -32,7 +49,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
static func getThreadLocalStorageValueForKey<T>(_ key: String) -> T? {
|
||||
static func getThreadLocalStorageValueForKey<T>(_ key: NSCopying) -> T? {
|
||||
let currentThread = Thread.current
|
||||
let threadDictionary = currentThread.threadDictionary
|
||||
|
||||
|
Reference in New Issue
Block a user