From df8038e9c7341ef470318aaafe517074aa553349 Mon Sep 17 00:00:00 2001 From: joe Date: Tue, 11 Feb 2014 20:48:34 -0500 Subject: Switched to throw-to instead of hClose to quit reader thread --- Presence/Server.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Presence/Server.hs') diff --git a/Presence/Server.hs b/Presence/Server.hs index 1d586900..e5ceaf2d 100644 --- a/Presence/Server.hs +++ b/Presence/Server.hs @@ -482,8 +482,8 @@ connectionThreads h pinglogic = do let finished e = do hClose h -- warn $ "finished read: " <> bshow (fmap ioeGetErrorType e) - let _ = fmap ioeGetErrorType e -- type hint - -- let _ = fmap what e where what (SomeException _) = undefined + -- let _ = fmap ioeGetErrorType e -- type hint + let _ = fmap what e where what (SomeException _) = undefined atomically $ do tryTakeTMVar outs putTMVar outs Nothing -- quit writer putTMVar doner () @@ -498,8 +498,8 @@ connectionThreads h pinglogic = do writerThread <- forkIO . fix $ \loop -> do let finished = do -- warn $ "finished write" - hClose h -- quit reader - -- throwTo readerThread (ErrorCall "EOF") + -- hClose h -- quit reader + throwTo readerThread (ErrorCall "EOF") atomically $ putTMVar donew () mb <- atomically $ readTMVar outs case mb of Just bs -> handle (\(SomeException e)->finished) -- cgit v1.2.3