<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Thread/setThreadPriority(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSThread(cm)setThreadPriority:"
  },
  "title" : "setThreadPriority(_:)"
}
-->

# setThreadPriority(_:)

Sets the current thread’s priority.

```
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

<doc://com.apple.documentation/documentation/Swift/true> if the priority assignment succeeded, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)