ios vpn app
This commit is contained in:
1 parent
96f16399d7
commit
1b506b9ee7
48 files changed
+4934
-45
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import Foundation
|
||||
|
||||
final class StatusHolder {
|
||||
static let shared = StatusHolder()
|
||||
|
||||
private let lock = NSLock()
|
||||
private var value = GoStatus.idle
|
||||
|
||||
func set(_ newValue: String) {
|
||||
Log.status.log("status = \(newValue, privacy: .public)")
|
||||
lock.lock()
|
||||
value = newValue
|
||||
lock.unlock()
|
||||
}
|
||||
|
||||
func get() -> String {
|
||||
lock.lock()
|
||||
defer { lock.unlock() }
|
||||
return value
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user