Hoogle Search
Within LTS Haskell 24.68 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
threadsAddTimeout :: (HasCallStack, MonadIO m) => Int32 -> Word32 -> SourceFunc -> m Word32gi-gdk3 GI.Gdk.Functions Sets a function to be called at regular intervals holding the GDK lock, with the given priority. The function is called repeatedly until it returns False, at which point the timeout is automatically destroyed and the function will not be called again. The notify function is called when the timeout is destroyed. The first call to the function will be at the end of the first interval. Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to “catch up” time lost in delays). This variant of timeoutAdd can be thought of a MT-safe version for GTK+ widgets for the following use case:
C code
static gboolean timeout_callback (gpointer data) { SomeWidget *self = data; // do stuff with self self->timeout_id = 0; return G_SOURCE_REMOVE; } static void some_widget_do_stuff_later (SomeWidget *self) { self->timeout_id = g_timeout_add (timeout_callback, self) } static void some_widget_finalize (GObject *object) { SomeWidget *self = SOME_WIDGET (object); if (self->timeout_id) g_source_remove (self->timeout_id); G_OBJECT_CLASS (parent_class)->finalize (object); }Since: 2.12threadsAddTimeoutSeconds :: (HasCallStack, MonadIO m) => Int32 -> Word32 -> SourceFunc -> m Word32gi-gdk3 GI.Gdk.Functions A variant of threadsAddTimeout with second-granularity. See timeoutAddSeconds for a discussion of why it is a good idea to use this function if you don’t need finer granularity. Since: 2.14
threadsEnter :: (HasCallStack, MonadIO m) => m ()gi-gdk3 GI.Gdk.Functions Deprecated: (Since version 3.6)All GDK and GTK+ calls should be made from the mainthread
threadsInit :: (HasCallStack, MonadIO m) => m ()gi-gdk3 GI.Gdk.Functions Deprecated: (Since version 3.6)All GDK and GTK+ calls should be made from the mainthread
threadsLeave :: (HasCallStack, MonadIO m) => m ()gi-gdk3 GI.Gdk.Functions Deprecated: (Since version 3.6)All GDK and GTK+ calls should be made from the mainthread
-
ki Ki Bound to an OS thread.
-
ki Ki A thread.
👉 Details
- A thread's lifetime is delimited by the scope in which it was created.
- The thread that creates a scope is considered the parent of all threads created within it.
- If an exception is raised in a child thread, the child either propagates the exception to its parent (see fork), or returns the exception as a value (see forkTry).
- All threads created within a scope are terminated when the scope closes.
-
ki Ki What, if anything, a thread is bound to.
-
ki Ki - affinity The affinity of a thread. A thread can be unbound, bound to a specific capability, or bound to a specific OS thread.Default: Unbound
- allocationLimit The maximum number of bytes a thread may allocate before it is delivered an AllocationLimitExceeded exception. If caught, the thread is allowed to allocate an additional 100kb (tunable with +RTS -xq) to perform any necessary cleanup actions; if exceeded, the thread is delivered another.Default: Nothing (no limit)
- label The label of a thread, visible in the event log (+RTS -l).Default: "" (no label)
- maskingState The masking state a thread is created in. To unmask, use unsafeUnmask.Default: Unmasked
ThreadOptions :: ThreadAffinity -> Maybe ByteCount -> String -> MaskingState -> ThreadOptionski Ki No documentation available.