diff options
author | Joey Hess <joey@kitenet.net> | 2013-01-26 14:14:32 +1100 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-01-26 14:14:32 +1100 |
commit | 44d7913686ccfef4e6cbd0fdc2b5611aa944ec70 (patch) | |
tree | b8343b59f6730ff31fb7b88ffc11e13073d88c8e /Assistant/Types/DaemonStatus.hs | |
parent | 28eb1f598b1f494b6de815593fa8bfb9aaaeb250 (diff) |
use async to track and manage threads
Diffstat (limited to 'Assistant/Types/DaemonStatus.hs')
-rw-r--r-- | Assistant/Types/DaemonStatus.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Assistant/Types/DaemonStatus.hs b/Assistant/Types/DaemonStatus.hs index 7f868d957..6c949c8f4 100644 --- a/Assistant/Types/DaemonStatus.hs +++ b/Assistant/Types/DaemonStatus.hs @@ -16,12 +16,15 @@ import Utility.NotificationBroadcaster import Logs.Transfer import Control.Concurrent.STM +import Control.Concurrent.Async import Data.Time.Clock.POSIX import qualified Data.Map as M data DaemonStatus = DaemonStatus + -- All the named threads that comprise the daemon. + { startedThreads :: M.Map String (Async ()) -- False when the daemon is performing its startup scan - { scanComplete :: Bool + , scanComplete :: Bool -- Time when a previous process of the daemon was running ok , lastRunning :: Maybe POSIXTime -- True when the sanity checker is running @@ -58,7 +61,8 @@ type DaemonStatusHandle = TMVar DaemonStatus newDaemonStatus :: IO DaemonStatus newDaemonStatus = DaemonStatus - <$> pure False + <$> pure M.empty + <*> pure False <*> pure Nothing <*> pure False <*> pure Nothing |