[commit: packages/stm] master: sync newBroadcastTChanIO with newBroadcastTChan (1187332)

git at git.haskell.org git
Tue Oct 1 10:11:25 UTC 2013


Repository : ssh://git at git.haskell.org/stm

On branch  : master
Link       : http://git.haskell.org/packages/stm.git/commitdiff/1187332f18de8bdd8ede1d940fe035fe0acac424

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

commit 1187332f18de8bdd8ede1d940fe035fe0acac424
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Mon May 27 20:08:39 2013 +0100

    sync newBroadcastTChanIO with newBroadcastTChan
    
    Spotted by wren ng thornton <wren at freegeek.org> on
    libraries at haskell.org


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

1187332f18de8bdd8ede1d940fe035fe0acac424
 Control/Concurrent/STM/TChan.hs |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Control/Concurrent/STM/TChan.hs b/Control/Concurrent/STM/TChan.hs
index a587079..06b4f4e 100644
--- a/Control/Concurrent/STM/TChan.hs
+++ b/Control/Concurrent/STM/TChan.hs
@@ -105,9 +105,8 @@ newBroadcastTChan = do
 -- | @IO@ version of 'newBroadcastTChan'.
 newBroadcastTChanIO :: IO (TChan a)
 newBroadcastTChanIO = do
-    dummy_hole <- newTVarIO TNil
     write_hole <- newTVarIO TNil
-    read <- newTVarIO dummy_hole
+    read <- newTVarIO (error "reading from a TChan created by newBroadcastTChanIO; use dupTChan first")
     write <- newTVarIO write_hole
     return (TChan read write)
 




More information about the ghc-commits mailing list