Add new pods.

- RxSwift
- RXCocoa
This commit is contained in:
Qiu Yuzhou
2017-03-17 23:08:52 +08:00
parent 0bbc55748c
commit 24836d203a
227 changed files with 23130 additions and 572 deletions

View File

@ -0,0 +1,49 @@
//
// Platform.Darwin.swift
// Platform
//
// Created by Krunoslav Zaher on 12/29/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
import Foundation
typealias AtomicInt = Int32
let AtomicCompareAndSwap = OSAtomicCompareAndSwap32Barrier
let AtomicIncrement = OSAtomicIncrement32Barrier
let AtomicDecrement = OSAtomicDecrement32Barrier
extension Thread {
static func setThreadLocalStorageValue<T: AnyObject>(_ value: T?, forKey key: String
) {
let currentThread = Thread.current
let threadDictionary = currentThread.threadDictionary
if let newValue = value {
threadDictionary[key] = newValue
}
else {
threadDictionary[key] = nil
}
}
static func getThreadLocalStorageValueForKey<T>(_ key: String) -> T? {
let currentThread = Thread.current
let threadDictionary = currentThread.threadDictionary
return threadDictionary[key] as? T
}
}
extension AtomicInt {
func valueSnapshot() -> Int32 {
return self
}
}
#endif