---
title: init
framework: kernel
role: pseudoSymbol
path: kernel/iogatedoutputqueue/1812930-init
---

# init

Initializes an IOGatedOutputQueue object.

## Declaration

```occ
virtual bool init(
 OSObject *target, 
 IOOutputAction action, 
 IOWorkLoop *workloop, 
 UInt32 capacity = 0, 
 UInt32 priorities = 1); 
```

## Parameters

- `target`: The object that will handle packets removed from the queue, and is usually a subclass of IONetworkController.
- `action`: The function that will handle packets removed from the queue.
- `workloop`: A workloop object. An IOCommandGate object is created and added to this workloop as an event source.
- `capacity`: The initial capacity of the output queue.

## Return Value

Return Value Returns true if initialized successfully, false otherwise.

## See Also

### Miscellaneous

- [free](kernel/iogatedoutputqueue/1812925-free.md)
- [output(IOMbufQueue *, UInt32 *)](kernel/iogatedoutputqueue/1812936-output.md)
- [output(void *)](kernel/iogatedoutputqueue/1812941-output.md)
- [scheduleServiceThread](kernel/iogatedoutputqueue/1812945-scheduleservicethread.md)
- [withTarget(IONetworkController *, IOWorkLoop *, UInt32)](kernel/iogatedoutputqueue/1812948-withtarget.md)
- [withTarget(IONetworkController *, IOWorkLoop *, UInt32, UInt32)](kernel/iogatedoutputqueue/1812950-withtarget.md)
- [withTarget(OSObject *, IOOutputAction, IOWorkLoop *, UInt32)](kernel/iogatedoutputqueue/1812954-withtarget.md)
- [withTarget(OSObject *, IOOutputAction, IOWorkLoop *, UInt32, UInt32)](kernel/iogatedoutputqueue/1812957-withtarget.md)
