---
title: getCommand
framework: kernel
role: pseudoSymbol
path: kernel/iocommandpool/1811062-getcommand
---

# getCommand

## Declaration

```occ
virtual IOCommand *getCommand(
 bool blockForCommand = true); 
```

## 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

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.

## Overview

Overview The getCommand method is used to get a pointer to an object of type IOCommand from the pool.

## See Also

### Miscellaneous

- [commandPool](kernel/iocommandpool/1811017-commandpool.md)
- [gatedGetCommand](kernel/iocommandpool/1811028-gatedgetcommand.md)
- [gatedReturnCommand](kernel/iocommandpool/1811045-gatedreturncommand.md)
- [init](kernel/iocommandpool/1811075-init.md)
- [initWithWorkLoop](kernel/iocommandpool/1811086-initwithworkloop.md)
- [returnCommand](kernel/iocommandpool/1811102-returncommand.md)
- [withWorkLoop(IOService *, IOWorkLoop *, UInt32)](kernel/iocommandpool/1811120-withworkloop.md)
- [withWorkLoop(IOWorkLoop *)](kernel/iocommandpool/1811136-withworkloop.md)
