---
title: "CMSimpleQueueCreate(allocator:capacity:queueOut:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmsimplequeuecreate(allocator:capacity:queueout:)"
---

# CMSimpleQueueCreate(allocator:capacity:queueOut:)

Creates a queue that has the specified capacity.

## Declaration

```swift
func CMSimpleQueueCreate(allocator: CFAllocator?, capacity: Int32, queueOut: UnsafeMutablePointer<CMSimpleQueue?>) -> OSStatus
```

## Parameters

- `allocator`: Allocator used to allocate storage for the queue.
- `capacity`: Capacity of the queue (maximum number of elements holdable at any given time). Required (must not be 0). Must be a positive value.
- `queueOut`: On output, a reference to the newly created queue. Must not be NULL.

## Return Value

Return Value A result code. See Simple Queue Error Codes.

## Discussion

Discussion On return, the caller owns the returned CMSimpleQueue, and must release it when done with it.
