From 639d246aa0151902cfc41a19c45a98cc678f0d23 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 14 Aug 2007 14:50:28 +0000 Subject: [PATCH] Correct the swapMVar haddock doc --- Control/Concurrent/MVar.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Control/Concurrent/MVar.hs b/Control/Concurrent/MVar.hs index fc3a30a..a5dc267 100644 --- a/Control/Concurrent/MVar.hs +++ b/Control/Concurrent/MVar.hs @@ -59,7 +59,12 @@ readMVar m = putMVar m a return a --- |Atomically, put a new value into an 'MVar' and return the old value. +{-| + Take a value from an 'MVar', put a new value into the 'MVar' and + return the value taken. Note that there is a race condition whereby + another process can put something in the 'MVar' after the take + happens but before the put does. +-} swapMVar :: MVar a -> a -> IO a swapMVar mvar new = block $ do -- 1.7.10.4