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

@ -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