putMVar

Put a value into an MVar. If the MVar is currently full, putMVar will wait until it becomes empty. There are two further important properties of putMVar:
  • putMVar is single-wakeup. That is, if there are multiple threads blocked in putMVar, and the MVar becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its putMVar operation.
  • When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.
Put a value into an MVar. If the MVar is currently full, putMVar will wait until it becomes empty. There are two further important properties of putMVar:
  • putMVar is single-wakeup. That is, if there are multiple threads blocked in putMVar, and the MVar becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its putMVar operation.
  • When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.
Lifted putMVar.
Generalized version of putMVar.
Lifted to MonadIO version of putMVar.
Put a value into a MVar. If there is already a value there, this will block until that value has been taken, at which point the value will be stored.
Put a value into an MVar. If the MVar is currently full, putMVar will wait until it becomes empty. There are two further important properties of putMVar:
  • putMVar is single-wakeup. That is, if there are multiple threads blocked in putMVar, and the MVar becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its putMVar operation.
  • When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.
Put into a MVar, possibly waking up some threads.
putMVar for an MVar'. Evaluates the new value to WHNF.
A non-blocking version of putMVar. The tryPutMVar function attempts to put the value a into the MVar, returning True if it was successful, or False otherwise.
A non-blocking version of putMVar. The tryPutMVar function attempts to put the value a into the MVar, returning True if it was successful, or False otherwise.
Lifted tryPutMVar.
Generalized version of tryPutMVar.
Lifted to MonadIO version of tryPutMVar.
Attempt to put a value in a MVar non-blockingly, returning True (and filling the MVar) if there was nothing there, otherwise returning False.
Get blocked on a put.
Try to put into a MVar, possibly waking up some threads.