summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>2007-10-06 12:54:47 +0200
committerDmitry Kurochkin <dmitry.kurochkin@gmail.com>2007-10-06 12:54:47 +0200
commited885c39e52be7a81163fcdddd9fd00e30c6eb8a (patch)
tree6ee6ff8ff4bcee2bccc85897ae43c22ac938d274
parent94a42859c1783bc36b37e139d89a6163e066bf46 (diff)
downloadxmobar-ed885c39e52be7a81163fcdddd9fd00e30c6eb8a.tar.gz
xmobar-ed885c39e52be7a81163fcdddd9fd00e30c6eb8a.tar.bz2
Remove MVar from eventLoop.
darcs-hash:20071006105447-903e8-d5b4a5499d79f5749ca8630afb98b6eef7590510.gz
-rw-r--r--Xmobar.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Xmobar.hs b/Xmobar.hs
index e8091a7..ac7ca40 100644
--- a/Xmobar.hs
+++ b/Xmobar.hs
@@ -70,12 +70,11 @@ runX c d w f = runReaderT f (XConf d w c)
-- | The event loop
eventLoop :: Config -> [(Maybe ThreadId, TVar String)] -> Display -> Window -> IO ()
-eventLoop c v d w = do
- b <- newEmptyMVar
+eventLoop c v d w = block $ do
tv <- atomically $ newTVar []
- t <- forkIO (block $ do putMVar b (); go tv)
- takeMVar b
- checker t tv ""
+ t <- myThreadId
+ forkIO $ checker t tv ""
+ go tv
where
-- interrupt the drawing thread every time a var is updated
checker t tvar ov = do