---
title: "setThreadPriority(_:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/thread/setthreadpriority(_:)"
---

# setThreadPriority(_:)

Sets the current thread’s priority.

## Declaration

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

## Parameters

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

## Return Value

Return Value true if the priority assignment succeeded, false otherwise.

## Discussion

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

## See Also

### Prioritizing Thread Work

- [qualityOfService](foundation/thread/qualityofservice.md)
- [QualityOfService](foundation/qualityofservice.md)
- [threadPriority()](foundation/thread/threadpriority().md)
- [threadPriority](foundation/thread/threadpriority.md)
