Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This object provides an abstraction for creating threads. The default implementation uses a regular GThreadPool to start tasks.
Subclasses can be made to create custom threads.
Synopsis
- newtype TaskPool = TaskPool (ManagedPtr TaskPool)
- class (GObject o, IsDescendantOf TaskPool o) => IsTaskPool o
- toTaskPool :: (MonadIO m, IsTaskPool o) => o -> m TaskPool
- taskPoolCleanup :: (HasCallStack, MonadIO m, IsTaskPool a) => a -> m ()
- taskPoolJoin :: (HasCallStack, MonadIO m, IsTaskPool a) => a -> Ptr () -> m ()
- taskPoolNew :: (HasCallStack, MonadIO m) => m TaskPool
- taskPoolPrepare :: (HasCallStack, MonadIO m, IsTaskPool a) => a -> m ()
- taskPoolPush :: (HasCallStack, MonadIO m, IsTaskPool a) => a -> TaskPoolFunction -> m (Ptr ())
Exported types
Memory-managed wrapper type.
Instances
Eq TaskPool Source # | |
GObject TaskPool Source # | |
Defined in GI.Gst.Objects.TaskPool | |
ManagedPtrNewtype TaskPool Source # | |
Defined in GI.Gst.Objects.TaskPool toManagedPtr :: TaskPool -> ManagedPtr TaskPool | |
TypedObject TaskPool Source # | |
Defined in GI.Gst.Objects.TaskPool | |
HasParentTypes TaskPool Source # | |
Defined in GI.Gst.Objects.TaskPool | |
IsGValue (Maybe TaskPool) Source # | Convert |
Defined in GI.Gst.Objects.TaskPool gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe TaskPool -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe TaskPool) | |
type ParentTypes TaskPool Source # | |
Defined in GI.Gst.Objects.TaskPool |
class (GObject o, IsDescendantOf TaskPool o) => IsTaskPool o Source #
Type class for types which can be safely cast to TaskPool
, for instance with toTaskPool
.
Instances
(GObject o, IsDescendantOf TaskPool o) => IsTaskPool o Source # | |
Defined in GI.Gst.Objects.TaskPool |
toTaskPool :: (MonadIO m, IsTaskPool o) => o -> m TaskPool Source #
Methods
Click to display all available methods, including inherited ones
Methods
addControlBinding, bindProperty, bindPropertyFull, cleanup, defaultError, forceFloating, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, isFloating, join, notify, notifyByPspec, prepare, push, ref, refSink, removeControlBinding, runDispose, stealData, stealQdata, suggestNextSync, syncValues, thawNotify, unparent, unref, watchClosure.
Getters
getControlBinding, getControlRate, getData, getGValueArray, getName, getParent, getPathString, getProperty, getQdata, getValue.
Setters
setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setName, setParent, setProperty.
cleanup
:: (HasCallStack, MonadIO m, IsTaskPool a) | |
=> a |
|
-> m () |
Wait for all tasks to be stopped. This is mainly used internally to ensure proper cleanup of internal data structures in test suites.
MT safe.
join
:: (HasCallStack, MonadIO m, IsTaskPool a) | |
=> a |
|
-> Ptr () |
|
-> m () |
Join a task and/or return it to the pool. id
is the id obtained from
taskPoolPush
.
new
:: (HasCallStack, MonadIO m) | |
=> m TaskPool | Returns: a new |
Create a new default task pool. The default task pool will use a regular GThreadPool for threads.
prepare
:: (HasCallStack, MonadIO m, IsTaskPool a) | |
=> a |
|
-> m () | (Can throw |
Prepare the taskpool for accepting taskPoolPush
operations.
MT safe.
push
:: (HasCallStack, MonadIO m, IsTaskPool a) | |
=> a |
|
-> TaskPoolFunction |
|
-> m (Ptr ()) | Returns: a pointer that should be used
for the gst_task_pool_join function. This pointer can be |
Start the execution of a new thread from pool
.