miso
Copyright(C) 2016-2025 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Miso.Concurrent

Description

 
Synopsis

Synchronization primitives

data Waiter Source #

Synchronization primitive for event loop

Constructors

Waiter 

Fields

  • wait :: IO ()

    Blocks on MVar

  • notify :: IO ()

    Unblocks threads waiting on MVar

waiter :: IO Waiter Source #

Creates a new Waiter

Useful for multiple threads to wake-up / notify a single thread running in an infinite loop, waiting for work (e.g. to process an event queue).

oneshot :: IO Waiter Source #

Creates a new Waiter

Useful for a single thread to wake-up multiple threads that are waiting to run a oneshot task (e.g. like forking a thread).