---
title: withQueue
framework: DriverKit
role: symbol
role_heading: Static Method
platforms: [DriverKit, iOS, iPadOS, macOS]
path: driverkit/iocommandpool/3758244-withqueue
---

# withQueue

## Declaration

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

Primary factory method for the IOCommandPool class

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.
