Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
The AtomicQueue
object implements a queue that can be used from multiple
threads without performing any blocking operations.
Synopsis
- newtype AtomicQueue = AtomicQueue (ManagedPtr AtomicQueue)
- noAtomicQueue :: Maybe AtomicQueue
- atomicQueueLength :: (HasCallStack, MonadIO m) => AtomicQueue -> m Word32
- atomicQueueNew :: (HasCallStack, MonadIO m) => Word32 -> m AtomicQueue
- atomicQueuePeek :: (HasCallStack, MonadIO m) => AtomicQueue -> m (Ptr ())
- atomicQueuePop :: (HasCallStack, MonadIO m) => AtomicQueue -> m (Ptr ())
- atomicQueuePush :: (HasCallStack, MonadIO m) => AtomicQueue -> Ptr () -> m ()
- atomicQueueRef :: (HasCallStack, MonadIO m) => AtomicQueue -> m ()
- atomicQueueUnref :: (HasCallStack, MonadIO m) => AtomicQueue -> m ()
Exported types
newtype AtomicQueue Source #
Memory-managed wrapper type.
Instances
BoxedObject AtomicQueue Source # | |
Defined in GI.Gst.Structs.AtomicQueue boxedType :: AtomicQueue -> IO GType # |
noAtomicQueue :: Maybe AtomicQueue Source #
A convenience alias for Nothing
:: Maybe
AtomicQueue
.
Methods
length
:: (HasCallStack, MonadIO m) | |
=> AtomicQueue |
|
-> m Word32 | Returns: the number of elements in the queue. |
Get the amount of items in the queue.
new
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m AtomicQueue | Returns: a new |
Create a new atomic queue instance. initialSize
will be rounded up to the
nearest power of 2 and used as the initial size of the queue.
peek
:: (HasCallStack, MonadIO m) | |
=> AtomicQueue |
|
-> m (Ptr ()) | Returns: the head element of |
Peek the head element of the queue without removing it from the queue.
pop
:: (HasCallStack, MonadIO m) | |
=> AtomicQueue |
|
-> m (Ptr ()) | Returns: the head element of |
Get the head element of the queue.
push
:: (HasCallStack, MonadIO m) | |
=> AtomicQueue |
|
-> Ptr () |
|
-> m () |
Append data
to the tail of the queue.
ref
:: (HasCallStack, MonadIO m) | |
=> AtomicQueue |
|
-> m () |
Increase the refcount of queue
.
unref
:: (HasCallStack, MonadIO m) | |
=> AtomicQueue |
|
-> m () |
Unref queue
and free the memory when the refcount reaches 0.