[commit: stm] master: Throw an exception when reading from a broadcast channel (#7218) (4965c01)
Simon Marlow
marlowsd at gmail.com
Thu Sep 6 10:46:32 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/stm
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/4965c0139de186c8322cb48b52550acb4b8d9afa
>---------------------------------------------------------------
commit 4965c0139de186c8322cb48b52550acb4b8d9afa
Author: Simon Marlow <marlowsd at gmail.com>
Date: Thu Sep 6 09:46:20 2012 +0100
Throw an exception when reading from a broadcast channel (#7218)
>---------------------------------------------------------------
Control/Concurrent/STM/TChan.hs | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Control/Concurrent/STM/TChan.hs b/Control/Concurrent/STM/TChan.hs
index 52af426..455dafe 100644
--- a/Control/Concurrent/STM/TChan.hs
+++ b/Control/Concurrent/STM/TChan.hs
@@ -97,9 +97,8 @@ newTChanIO = do
-- garbage collected after clients have seen them.
newBroadcastTChan :: STM (TChan a)
newBroadcastTChan = do
- dummy_hole <- newTVar TNil
write_hole <- newTVar TNil
- read <- newTVar dummy_hole
+ read <- newTVar (error "reading from a TChan created by newBroadcastTChan; use dupTChan first")
write <- newTVar write_hole
return (TChan read write)
More information about the Cvs-libraries
mailing list