on master help sign in
better naming.
commitb14f9ca93473252af8466d14176e4cc64262082c authorKazu Yamamoto <kazu@iij.ad.jp> dateWed 6 Aug 2014, 15:05 (12 years ago) parent03fa153
1 file changed+6−6
auto-update/Control/Reaper.hs+6−6
auto-update/Control/Reaper.hs+6−6
@@ -112,10 +112,10 @@ update settings@ReaperSettings{..} stateRef item =
112112 ,return ())
113113
114114spawn :: ReaperSettings workload item -> IORef (State workload) -> IO ()
115−spawn settings stateRef = void . forkIO $ loop settings stateRef
115+spawn settings stateRef = void . forkIO $ reaper settings stateRef
116116
117−loop :: ReaperSettings workload item -> IORef (State workload) -> IO ()
118−loop settings@ReaperSettings{..} stateRef = do
117+reaper :: ReaperSettings workload item -> IORef (State workload) -> IO ()
118+reaper settings@ReaperSettings{..} stateRef = do
119119 threadDelay reaperDelay
120120 -- Getting the current jobs. Push an empty job to the reference.
121121 wl <- atomicModifyIORef' stateRef swapWithEmpty
@@ -126,15 +126,15 @@ loop settings@ReaperSettings{..} stateRef = do
126126 -- If there is no jobs, this thread finishes.
127127 join $ atomicModifyIORef' stateRef (check merge)
128128 where
129− swapWithEmpty NoReaper = error "Control.Reaper.loop: unexpected NoReaper (1)"
129+ swapWithEmpty NoReaper = error "Control.Reaper.reaper: unexpected NoReaper (1)"
130130 swapWithEmpty (Workload wl) = (Workload reaperEmpty, wl)
131131
132− check _ NoReaper = error "Control.Reaper.loop: unexpected NoReaper (2)"
132+ check _ NoReaper = error "Control.Reaper.reaper: unexpected NoReaper (2)"
133133 check merge (Workload wl)
134134 -- If there is no job, reaper is terminated.
135135 | reaperNull wl' = (NoReaper, return ())
136136 -- If there are jobs, carry them out.
137− | otherwise = (Workload wl', loop settings stateRef)
137+ | otherwise = (Workload wl', reaper settings stateRef)
138138 where
139139 wl' = merge wl
140140