Hoogle Search
Within LTS Haskell 24.67 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
clearIOFuncsIoRead :: MonadIO m => IOFuncs -> m ()gi-glib GI.GLib.Structs.IOFuncs Set the value of the “io_read” field to Nothing. When overloading is enabled, this is equivalent to
clear #ioRead
getIOFuncsIoRead :: MonadIO m => IOFuncs -> m (Maybe IOFuncsIoReadFieldCallback)gi-glib GI.GLib.Structs.IOFuncs Get the value of the “io_read” field. When overloading is enabled, this is equivalent to
get iOFuncs #ioRead
setIOFuncsIoRead :: MonadIO m => IOFuncs -> FunPtr C_IOFuncsIoReadFieldCallback -> m ()gi-glib GI.GLib.Structs.IOFuncs Set the value of the “io_read” field. When overloading is enabled, this is equivalent to
set iOFuncs [ #ioRead := value ]
mainContextGetThreadDefault :: (HasCallStack, MonadIO m) => m (Maybe MainContext)gi-glib GI.GLib.Structs.MainContext Gets the thread-default MainContext for this thread. Asynchronous operations that want to be able to be run in contexts other than the default one should call this method or mainContextRefThreadDefault to get a MainContext to add their GSources to. (Note that even in single-threaded programs applications may sometimes want to temporarily push a non-default context, so it is not safe to assume that this will always return Nothing if you are running in the default thread.) If you need to hold a reference on the context, use mainContextRefThreadDefault instead. Since: 2.22
mainContextPopThreadDefault :: (HasCallStack, MonadIO m) => Maybe MainContext -> m ()gi-glib GI.GLib.Structs.MainContext Pops context off the thread-default context stack (verifying that it was on the top of the stack). Since: 2.22
mainContextPushThreadDefault :: (HasCallStack, MonadIO m) => Maybe MainContext -> m ()gi-glib GI.GLib.Structs.MainContext Acquires context and sets it as the thread-default context for the current thread. This will cause certain asynchronous operations (such as most [gio][gio]-based I/O) which are started in this thread to run under context and deliver their results to its main loop, rather than running under the global default main context in the main thread. Note that calling this function changes the context returned by mainContextGetThreadDefault, not the one returned by mainContextDefault, so it does not affect the context used by functions like g_idle_add(). Normally you would call this function shortly after creating a new thread, passing it a MainContext which will be run by a MainLoop in that thread, to set a new default context for all async operations in that thread. In this case you may not need to ever call mainContextPopThreadDefault, assuming you want the new MainContext to be the default for the whole lifecycle of the thread. If you don't have control over how the new thread was created (e.g. in the new thread isn't newly created, or if the thread life cycle is managed by a ThreadPool), it is always suggested to wrap the logic that needs to use the new MainContext inside a mainContextPushThreadDefault / mainContextPopThreadDefault pair, otherwise threads that are re-used will end up never explicitly releasing the MainContext reference they hold. In some cases you may want to schedule a single operation in a non-default context, or temporarily use a non-default context in the main thread. In that case, you can wrap the call to the asynchronous operation inside a mainContextPushThreadDefault / mainContextPopThreadDefault pair, but it is up to you to ensure that no other asynchronous operations accidentally get started while the non-default context is active. Beware that libraries that predate this function may not correctly handle being used from a thread with a thread-default context. Eg, see g_file_supports_thread_contexts(). Since: 2.22
mainContextRefThreadDefault :: (HasCallStack, MonadIO m) => m MainContextgi-glib GI.GLib.Structs.MainContext Gets the thread-default MainContext for this thread, as with mainContextGetThreadDefault, but also adds a reference to it with mainContextRef. In addition, unlike mainContextGetThreadDefault, if the thread-default context is the global-default context, this will return that MainContext (with a ref added to it) rather than returning Nothing. Since: 2.32
rWLockReaderLock :: (HasCallStack, MonadIO m) => RWLock -> m ()gi-glib GI.GLib.Structs.RWLock Obtain a read lock on rwLock. If another thread currently holds the write lock on rwLock, the current thread will block until the write lock was (held and) released. If another thread does not hold the write lock, but is waiting for it, it is implementation defined whether the reader or writer will block. Read locks can be taken recursively. Calling rWLockReaderLock while the current thread already owns a write lock leads to undefined behaviour. Read locks however can be taken recursively, in which case you need to make sure to call rWLockReaderUnlock the same amount of times. It is implementation-defined how many read locks are allowed to be held on the same lock simultaneously. If the limit is hit, or if a deadlock is detected, a critical warning will be emitted. Since: 2.32
rWLockReaderTrylock :: (HasCallStack, MonadIO m) => RWLock -> m Boolgi-glib GI.GLib.Structs.RWLock Tries to obtain a read lock on rwLock and returns True if the read lock was successfully obtained. Otherwise it returns False. Since: 2.32
rWLockReaderUnlock :: (HasCallStack, MonadIO m) => RWLock -> m ()gi-glib GI.GLib.Structs.RWLock Release a read lock on rwLock. Calling rWLockReaderUnlock on a lock that is not held by the current thread leads to undefined behaviour. Since: 2.32