Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
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 ()
- taskPoolDisposeHandle :: (HasCallStack, MonadIO m, IsTaskPool a) => a -> Ptr () -> 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 | |
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, disposeHandle, 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.
disposeHandle
taskPoolDisposeHandle Source #
:: (HasCallStack, MonadIO m, IsTaskPool a) | |
=> a |
|
-> Ptr () |
|
-> m () |
Dispose of the handle returned by taskPoolPush
. This does
not need to be called with the default implementation as the default
TaskPoolClass
::push
implementation always returns Nothing
. This does not need to be
called either when calling taskPoolJoin
, but should be called
when joining is not necessary, but taskPoolPush
returned a
non-Nothing
value.
This method should only be called with the same pool
instance that provided
id
.
Since: 1.20
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
. The default implementation does nothing, as the
default TaskPoolClass
::push
implementation always returns Nothing
.
This method should only be called with the same pool
instance that provided
id
.
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
.