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

# getCommand

```
virtual IOCommandPtr getCommand(bool blockForCommand);
```

## Parameters

`blockForCommand`

If the caller would like to have its thread slept until a command is
available, it should pass true, else false.

## Return Value

If the caller passes true in blockForCommand, getCommand guarantees that
the result will be a pointer to an IOCommand object from the pool. If
the caller passes false, s/he is responsible for checking whether a non-NULL
pointer was returned.

## Discussion\discussion The getCommand method is used to get a pointer to an object of type IOCommand from the pool.

---

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)