[commit: packages/base] master: Document another unsafeDupablePerformIO limitation. (8c24917)

git at git.haskell.org git at git.haskell.org
Tue Jan 7 14:31:47 UTC 2014


Repository : ssh://git@git.haskell.org/base

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8c249173042f978a1ce8503a76682547e61c8039/base

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

commit 8c249173042f978a1ce8503a76682547e61c8039
Author: Bertram Felgenhauer <int-e at gmx.de>
Date:   Mon Nov 4 15:57:51 2013 +0100

    Document another unsafeDupablePerformIO limitation.
    
    Signed-off-by: Austin Seipp <aseipp at pobox.com>


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

8c249173042f978a1ce8503a76682547e61c8039
 GHC/IO.hs |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/GHC/IO.hs b/GHC/IO.hs
index 2718c83..5309665 100644
--- a/GHC/IO.hs
+++ b/GHC/IO.hs
@@ -170,7 +170,10 @@ because it omits the check that the IO is only being performed by a
 single thread.  Hence, when you use 'unsafeDupablePerformIO',
 there is a possibility that the IO action may be performed multiple
 times (on a multiprocessor), and you should therefore ensure that
-it gives the same results each time.
+it gives the same results each time. It may even happen that one
+of the duplicated IO actions is only run partially, and then interrupted
+in the middle without an exception being raised. Therefore, functions
+like 'bracket' cannot be used safely within 'unsafeDupablePerformIO'.
 
 /Since: 4.4.0.0/
 -}



More information about the ghc-commits mailing list