on master help sign in
adding comments.
commitb46b82d32d5a5820c565a36e875c8c3262678254 authorKazu Yamamoto <kazu@iij.ad.jp> dateWed 6 Aug 2014, 12:50 (12 years ago) parent0b61620
1 file changed+2−1
auto-update/Control/AutoUpdate.hs+2−1
auto-update/Control/AutoUpdate.hs+2−1
@@ -146,7 +146,7 @@ spawn UpdateSettings{..} istatus = handle (onErr istatus) $ forever $ do
146146
147147onErr :: IORef (Status a) -> SomeException -> IO ()
148148onErr istatus ex = case fromException ex of
149− Just Replaced -> return ()
149+ Just Replaced -> return () -- this thread is terminated
150150 Nothing -> do
151151 tid <- myThreadId
152152 atomicModifyIORef' istatus $ clear tid
@@ -163,5 +163,6 @@ onErr istatus ex = case fromException ex of
163163 clear tid (AutoUpdated _ _ tid') | tid == tid' = (ManualUpdates 0, ())
164164 clear _ status = (status, ())
165165
166+-- | Throw an error to kill a thread.
166167stop :: IO a
167168stop = throwIO Replaced