Skip to content

MTY_QueueCreate

chrisd1100 edited this page Aug 25, 2022 · 1 revision

Create an MTY_Queue for thread safe serialization.

The queue is a multi-producer single-consumer style queue, meaning multiple threads can submit to the queue safely, but only a single thread can pop from it.

MTY_Queue *MTY_QueueCreate(
    uint32_t len,
    size_t   bufSize
);

Parameters

len (uint32_t)

The number of buffers in the queue.

bufSize (size_t)

The preallocated size of each buffer in the queue. If only pushing via MTY_QueuePushPtr, this can be set to 0.

Return value

MTY_Queue *

The returned MTY_Queue must be destroyed with MTY_QueueDestroy.

Platform support

Windows   macOS   Android   Linux   Web  

See also

Module: Struct

Clone this wiki locally