AsyncQueue

An opaque data structure which represents an asynchronous queue.

It should only be accessed through the g_async_queue_* functions.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

length
int length()

Returns the length of the queue.

lengthUnlocked
int lengthUnlocked()

Returns the length of the queue.

lock
void lock()

Acquires the queue's lock. If another thread is already holding the lock, this call will block until the lock becomes available.

pop
void* pop()

Pops data from the queue. If queue is empty, this function blocks until data becomes available.

popUnlocked
void* popUnlocked()

Pops data from the queue. If queue is empty, this function blocks until data becomes available.

push
void push(void* data)

Pushes the data into the queue.

pushFront
void pushFront(void* item)

Pushes the item into the queue. item must not be null. In contrast to glib.async_queue.AsyncQueue.push, this function pushes the new item ahead of the items already in the queue, so that it will be the next one to be popped off the queue.

pushFrontUnlocked
void pushFrontUnlocked(void* item)

Pushes the item into the queue. item must not be null. In contrast to glib.async_queue.AsyncQueue.pushUnlocked, this function pushes the new item ahead of the items already in the queue, so that it will be the next one to be popped off the queue.

pushSorted
void pushSorted(void* data, glib.types.CompareDataFunc func)

Inserts data into queue using func to determine the new position.

pushSortedUnlocked
void pushSortedUnlocked(void* data, glib.types.CompareDataFunc func)

Inserts data into queue using func to determine the new position.

pushUnlocked
void pushUnlocked(void* data)

Pushes the data into the queue.

refUnlocked
void refUnlocked()

Increases the reference count of the asynchronous queue by 1.

remove
bool remove(void* item)

Remove an item from the queue.

removeUnlocked
bool removeUnlocked(void* item)

Remove an item from the queue.

sort
void sort(glib.types.CompareDataFunc func)

Sorts queue using func.

sortUnlocked
void sortUnlocked(glib.types.CompareDataFunc func)

Sorts queue using func.

timedPop
void* timedPop(glib.time_val.TimeVal endTime)

Pops data from the queue. If the queue is empty, blocks until end_time or until data becomes available.

timedPopUnlocked
void* timedPopUnlocked(glib.time_val.TimeVal endTime)

Pops data from the queue. If the queue is empty, blocks until end_time or until data becomes available.

timeoutPop
void* timeoutPop(ulong timeout)

Pops data from the queue. If the queue is empty, blocks for timeout microseconds, or until data becomes available.

timeoutPopUnlocked
void* timeoutPopUnlocked(ulong timeout)

Pops data from the queue. If the queue is empty, blocks for timeout microseconds, or until data becomes available.

tryPop
void* tryPop()

Tries to pop data from the queue. If no data is available, null is returned.

tryPopUnlocked
void* tryPopUnlocked()

Tries to pop data from the queue. If no data is available, null is returned.

unlock
void unlock()

Releases the queue's lock.

unrefAndUnlock
void unrefAndUnlock()

Decreases the reference count of the asynchronous queue by 1 and releases the lock. This function must be called while holding the queue's lock. If the reference count went to 0, the queue will be destroyed and the memory allocated will be freed.