Files
ShadowsocksX-NG/Pods/RxCocoa/Platform/RecursiveLock.swift
Qiu Yuzhou e6a22971d8 Make project build pass with swift 4.0
- pod update
- Force compile rxcocoa and rxswift with swift 3.2
2018-01-17 15:24:12 +08:00

35 lines
719 B
Swift

//
// RecursiveLock.swift
// Platform
//
// Created by Krunoslav Zaher on 12/18/16.
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
import class Foundation.NSRecursiveLock
#if TRACE_RESOURCES
class RecursiveLock: NSRecursiveLock {
override init() {
_ = Resources.incrementTotal()
super.init()
}
override func lock() {
super.lock()
_ = Resources.incrementTotal()
}
override func unlock() {
super.unlock()
_ = Resources.decrementTotal()
}
deinit {
_ = Resources.decrementTotal()
}
}
#else
typealias RecursiveLock = NSRecursiveLock
#endif