<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IODispatchQueue/OnQueue",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IODispatchQueue@F@OnQueue#"
  },
  "title" : "OnQueue"
}
-->

# OnQueue

Returns a Boolean value that indicates whether the current thread matches the dispatch queue’s thread.

```
bool OnQueue();
```

## Return Value

`true` if the current thread is the same thread that the dispatch queue is using to execute its task.

## Discussion

Use this method to determine if your code is running on the same thread as the current dispatch queue.

---

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)