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

# IOCommandPool

```
class IOCommandPool;
```

## Overview

\abstract Manipulates a pool of commands which inherit from IOCommand.
\discussion The IOCommandPool class is used to manipulate a pool of commands which
inherit from IOCommand. The caller must put commands in the pool by creating
the command (via the controller’s factory method or a memory allocation)
and calling the returnCommand method with the newly created command as its
argument.

## Topics

### Instance Methods

[`virtual void free();`](/documentation/DriverKit/IOCommandPool/free)

[`virtual kern_return_t gatedGetCommand(IOCommand **command, bool blockForCommand);`](/documentation/DriverKit/IOCommandPool/gatedGetCommand)

[`virtual kern_return_t gatedReturnCommand(IOCommand *command);`](/documentation/DriverKit/IOCommandPool/gatedReturnCommand)

[`virtual IOCommandPtr getCommand(bool blockForCommand);`](/documentation/DriverKit/IOCommandPool/getCommand)

[`virtual bool init();`](/documentation/DriverKit/IOCommandPool/init)

[`virtual bool initWithQueue(IODispatchQueue *queue);`](/documentation/DriverKit/IOCommandPool/initWithQueue)

[`virtual void returnCommand(IOCommand *command);`](/documentation/DriverKit/IOCommandPool/returnCommand)

### Type Methods

[`static IOCommandPoolPtr withQueue(IODispatchQueue *queue);`](/documentation/DriverKit/IOCommandPool/withQueue)

## Relationships

### Inherits From

[`OSObject`](/documentation/DriverKit/OSObject)

---

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)