---
title: "withWorkLoop(IOWorkLoop *)"
framework: kernel
role: pseudoSymbol
path: kernel/iocommandpool/1811136-withworkloop
---

# withWorkLoop(IOWorkLoop *)

Primary factory method for the IOCommandPool class

## Declaration

```occ
static IOCommandPool *withWorkLoop(
 IOWorkLoop *inWorkLoop); 
```

## Parameters

- `inWorkLoop`: The workloop that this command pool should synchronize with.

## Return Value

Return Value Returns a pointer to an instance of IOCommandPool if successful, otherwise NULL.

## Overview

Overview The withWorkLoop method is what is known as a factory method. It creates a new instance of an IOCommandPool and returns a pointer to that object.

## See Also

### Miscellaneous

- [commandPool](kernel/iocommandpool/1811017-commandpool.md)
- [gatedGetCommand](kernel/iocommandpool/1811028-gatedgetcommand.md)
- [gatedReturnCommand](kernel/iocommandpool/1811045-gatedreturncommand.md)
- [getCommand](kernel/iocommandpool/1811062-getcommand.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)
