@@ -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