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

# withQueue

```
static IOCommandPoolPtr withQueue(IODispatchQueue *queue);
```

## Parameters

`queue`

The IODispatchQueue that this command pool should synchronize with.
This queue must have been allocated with the kIODispatchQueueReentrant
option.
Returns a pointer to an instance of IOCommandPool if successful,
otherwise NULL.

## Discussion\abstract Primary factory method for the IOCommandPool class
\discussion The withQueue method is what is known as a factory method. It creates
a new instance of an IOCommandPool and returns a pointer to that object.

---

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)