Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
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
- noTaskPool :: Maybe 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
GObject TaskPool Source # | |
Defined in GI.Gst.Objects.TaskPool gobjectType :: IO GType # | |
HasParentTypes TaskPool Source # | |
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
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
.