Type Method


Sets the current thread’s priority.


class func setThreadPriority(_ p: Double) -> Bool



The new priority, specified with a floating point number from 0.0 to 1.0, where 1.0 is highest priority.

Return Value

true if the priority assignment succeeded, false otherwise.


The priorities in this range are mapped to the operating system's priority values.

See Also

Prioritizing Thread Work

enum QualityOfService

Used to indicate the nature and importance of work to the system. Work with higher quality of service classes receive more resources than work with lower quality of service classes whenever there is resource contention.

class func threadPriority() -> Double

Returns the current thread’s priority.

var threadPriority: Double

The receiver’s priority