mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
552 B
Swift
23 lines
552 B
Swift
8 years ago
|
//
|
||
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
/**
|
||
|
* We synchronize access to state in this class using this queue.
|
||
|
*/
|
||
8 years ago
|
public func assertOnQueue(_ queue: DispatchQueue) {
|
||
8 years ago
|
if #available(iOS 10.0, *) {
|
||
|
dispatchPrecondition(condition: .onQueue(queue))
|
||
|
} else {
|
||
|
// Skipping check on <iOS10, since syntax is different and it's just a development convenience.
|
||
|
}
|
||
|
}
|
||
|
|
||
8 years ago
|
public func owsFail(_ message: String) {
|
||
8 years ago
|
Logger.error(message)
|
||
|
Logger.flush()
|
||
|
assertionFailure(message)
|
||
|
}
|