Files
OrderScheduling/Pods/RxCocoa/Platform/DispatchQueue+Extensions.swift
DDIsFriend f0e8a1709d initial
2023-08-18 17:28:57 +08:00

22 lines
486 B
Swift

//
// DispatchQueue+Extensions.swift
// Platform
//
// Created by Krunoslav Zaher on 10/22/16.
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
import Dispatch
extension DispatchQueue {
private static var token: DispatchSpecificKey<()> = {
let key = DispatchSpecificKey<()>()
DispatchQueue.main.setSpecific(key: key, value: ())
return key
}()
static var isMain: Bool {
DispatchQueue.getSpecific(key: token) != nil
}
}