[commit: ghc] master: Update docs for readMVar/tryReadMVar. (2f99cdb)

Edward Z. Yang ezyang at ghc.haskell.org
Wed Jul 17 07:08:56 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2f99cdb9f9e561f29d726fea90a5a98de7499a2d

>---------------------------------------------------------------

commit 2f99cdb9f9e561f29d726fea90a5a98de7499a2d
Author: Edward Z. Yang <ezyang at mit.edu>
Date:   Tue Jul 16 22:08:51 2013 -0700

    Update docs for readMVar/tryReadMVar.
    
    Signed-off-by: Edward Z. Yang <ezyang at mit.edu>

>---------------------------------------------------------------

 docs/users_guide/7.8.1-notes.xml |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/docs/users_guide/7.8.1-notes.xml b/docs/users_guide/7.8.1-notes.xml
index 8e7685e..6c829c8 100644
--- a/docs/users_guide/7.8.1-notes.xml
+++ b/docs/users_guide/7.8.1-notes.xml
@@ -279,12 +279,16 @@
            </listitem>
             <listitem>
                 <para>
-                    <literal>Control.Concurrent.MVar</literal> has two
-                    new functions, <literal>atomicReadMVar</literal> and
-                    <literal>tryAtomicReadMVar</literal>, which
-                    implement <literal>readMVar</literal> that cannot be
-                    affected by other threads. (XXXX we may change the implementation
-                    of <literal>readMVar</literal> to use this.)
+                    <literal>Control.Concurrent.MVar</literal> has a new
+                    implementation of <literal>readMVar</literal>, which
+                    fixes a long-standing bug where
+                    <literal>readMVar</literal> is only atomic if there
+                    are no other threads running
+                    <literal>putMVar</literal>.
+                    <literal>readMVar</literal> now is atomic, and is
+                    guaranteed to return the value from the first
+                    <literal>putMVar</literal>.  There is also a new <literal>tryReadMVar</literal>
+                    which is a non-blocking version.
                </para>
            </listitem>
        </itemizedlist>






More information about the ghc-commits mailing list