Open Classswift 6.0.3Foundation
Thread
class Thread
class Thread
import Foundation
class NSObject
The root class of most Foundation class hierarchies.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol NSObjectProtocol : AnyObject
The NSObjectProtocol
groups methods that are fundamental to all Foundation objects.
override init()
convenience init(block: @escaping () -> Void)
class var callStackReturnAddresses: [NSNumber] { get }
class var callStackSymbols: [String] { get }
class var current: Thread { get }
class var isMainThread: Bool { get }
class var mainThread: Thread { get }
class func detachNewThread(_ block: @escaping () -> Void)
Alternative API for detached thread creation
class func exit()
class func isMultiThreaded() -> Bool
class func sleep(forTimeInterval interval: TimeInterval)
class func sleep(until date: Date)
var isCancelled: Bool { get }
var isExecuting: Bool { get }
var isFinished: Bool { get }
var isMainThread: Bool { get }
var name: String? { get set }
var qualityOfService: QualityOfService
var stackSize: Int { get set }
var threadDictionary: NSMutableDictionary { get }
func cancel()
func main()
func start()
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
@preconcurrency static func async(_ work: @escaping () -> ())
Convenience wrapper around Thread.detachNewThread
.