mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-05 06:27:29 +03:00
getting SPM working on Linux
This commit is contained in:
parent
ddb514c4e9
commit
3023000806
@ -36,12 +36,6 @@ let package = Package(
|
||||
Target(
|
||||
name: "RxSwift"
|
||||
),
|
||||
Target(
|
||||
name: "RxTests",
|
||||
dependencies: [
|
||||
.Target(name: "RxSwift")
|
||||
]
|
||||
),
|
||||
Target(
|
||||
name: "RxBlocking",
|
||||
dependencies: [
|
||||
@ -49,7 +43,7 @@ let package = Package(
|
||||
]
|
||||
),
|
||||
Target(
|
||||
name: "AllTests",
|
||||
name: "RxSwiftTests",
|
||||
dependencies: [
|
||||
.Target(name: "RxSwift"),
|
||||
.Target(name: "RxBlocking"),
|
||||
@ -59,6 +53,9 @@ let package = Package(
|
||||
],
|
||||
exclude: [
|
||||
"Sources/RxCocoa",
|
||||
"Sources/RxTests",
|
||||
"Sources/AllTests",
|
||||
"Tests/RxCocoaTests"
|
||||
]
|
||||
)
|
||||
#endif
|
||||
|
@ -36,17 +36,17 @@ protocol Lock {
|
||||
pthread_spin_unlock(&_lock)
|
||||
}
|
||||
|
||||
func performLocked(@noescape action: () -> Void) {
|
||||
func performLocked(action: () -> Void) {
|
||||
lock(); defer { unlock() }
|
||||
action()
|
||||
}
|
||||
|
||||
func calculateLocked<T>(@noescape action: () -> T) -> T {
|
||||
func calculateLocked<T>(action: () -> T) -> T {
|
||||
lock(); defer { unlock() }
|
||||
return action()
|
||||
}
|
||||
|
||||
func calculateLockedOrFail<T>(@noescape action: () throws -> T) throws -> T {
|
||||
func calculateLockedOrFail<T>(action: () throws -> T) throws -> T {
|
||||
lock(); defer { unlock() }
|
||||
let result = try action()
|
||||
return result
|
||||
|
@ -21,7 +21,7 @@ public class Observable<Element> : ObservableType {
|
||||
|
||||
init() {
|
||||
#if TRACE_RESOURCES
|
||||
OSAtomicIncrement32(&resourceCount)
|
||||
let _ = AtomicIncrement(&resourceCount)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
var runLoopCounter = 0
|
||||
|
||||
extension NSThread {
|
||||
extension Thread {
|
||||
public var isMainThread: Bool {
|
||||
return true
|
||||
}
|
||||
@ -92,9 +92,9 @@
|
||||
return false
|
||||
}
|
||||
|
||||
extension NSThread {
|
||||
extension Thread {
|
||||
static func setThreadLocalStorageValue<T: AnyObject>(value: T?, forKey key: String) {
|
||||
let currentThread = NSThread.currentThread()
|
||||
let currentThread = Thread.currentThread()
|
||||
var threadDictionary = currentThread.threadDictionary
|
||||
|
||||
if let newValue = value {
|
||||
@ -108,7 +108,7 @@
|
||||
}
|
||||
|
||||
static func getThreadLocalStorageValueForKey<T: AnyObject>(key: String) -> T? {
|
||||
let currentThread = NSThread.currentThread()
|
||||
let currentThread = Thread.currentThread()
|
||||
let threadDictionary = currentThread.threadDictionary
|
||||
|
||||
return threadDictionary[key] as? T
|
||||
|
@ -7,6 +7,9 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if os(Linux)
|
||||
import Dispatch
|
||||
#endif
|
||||
|
||||
/**
|
||||
Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. You can also pass a serial dispatch queue, it shouldn't cause any problems.
|
||||
|
@ -7,6 +7,9 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if os(Linux)
|
||||
import Dispatch
|
||||
#endif
|
||||
|
||||
struct DispatchQueueConfiguration {
|
||||
let queue: DispatchQueue
|
||||
|
@ -7,6 +7,9 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if os(Linux)
|
||||
import Dispatch
|
||||
#endif
|
||||
|
||||
/**
|
||||
Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure
|
||||
|
Loading…
Reference in New Issue
Block a user