mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
19 lines
403 B
Swift
19 lines
403 B
Swift
// Copyright 2017 Yandex LLC. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
extension Thread {
|
|
public static func assertIsMain() {
|
|
assert(isMainThread)
|
|
}
|
|
|
|
public static func assertIsNotMain() {
|
|
#if INTERNAL_BUILD
|
|
guard !isUnitTest else { return }
|
|
assert(!isMainThread)
|
|
#endif
|
|
}
|
|
}
|
|
|
|
private let isUnitTest = ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] != nil
|