summaryrefslogtreecommitdiff
path: root/Presence/LockedChan.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-02-22 01:02:57 -0500
committerjoe <joe@jerkface.net>2014-02-22 01:02:57 -0500
commit3fbeace3e43d07d726f8f8ecd7c0557ea847e3de (patch)
treea2052c9d11f8562f749c3e21d7904faf6b429e06 /Presence/LockedChan.hs
parent926f736e2c445348afa0ae02e8199d5866713434 (diff)
Switch to LockedChan, easier to debug.
Diffstat (limited to 'Presence/LockedChan.hs')
-rw-r--r--Presence/LockedChan.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Presence/LockedChan.hs b/Presence/LockedChan.hs
index e7e951bb..a562bc58 100644
--- a/Presence/LockedChan.hs
+++ b/Presence/LockedChan.hs
@@ -27,8 +27,13 @@ unlockChan c = do
27writeLChan :: LockedChan a -> a -> STM () 27writeLChan :: LockedChan a -> a -> STM ()
28writeLChan c a = writeTChan (chan c) a 28writeLChan c a = writeTChan (chan c) a
29 29
30-- This one blocks rather than throwing an exception...
31-- todo: probably this should be changed to conform to the rest
32-- of the api.
30peekLChan :: LockedChan a -> STM a 33peekLChan :: LockedChan a -> STM a
31peekLChan c = peekTChan (chan c) 34peekLChan c = do
35 readTVar (lock c) >>= check
36 peekTChan (chan c)
32 37
33newLockedChan :: STM (LockedChan a) 38newLockedChan :: STM (LockedChan a)
34newLockedChan = do 39newLockedChan = do