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

@ -7,20 +7,16 @@
//
#if os(Linux)
////////////////////////////////////////////////////////////////////////////////
// This is not the greatest API in the world, this is just a tribute.
// !!! Proof of concept until libdispatch becomes operational. !!!
////////////////////////////////////////////////////////////////////////////////
import Foundation
import XCTest
import Glibc
import SwiftShims
import class Foundation.Thread
final class AtomicInt {
typealias IntegerLiteralType = Int
fileprivate var value: Int32 = 0
fileprivate var _lock = NSRecursiveLock()
fileprivate var _lock = RecursiveLock()
func lock() {
_lock.lock()
@ -48,6 +44,18 @@
return lhs.value == rhs
}
func AtomicFlagSet(_ mask: UInt32, _ atomic: inout AtomicInt) -> Bool {
atomic.lock(); defer { atomic.unlock() }
return (atomic.value & Int32(mask)) != 0
}
func AtomicOr(_ mask: UInt32, _ atomic: inout AtomicInt) -> Int32 {
atomic.lock(); defer { atomic.unlock() }
let value = atomic.value
atomic.value |= Int32(mask)
return value
}
func AtomicIncrement(_ atomic: inout AtomicInt) -> Int32 {
atomic.lock(); defer { atomic.unlock() }
atomic.value += 1