on master help sign in
layout only
commitd8a4a0c3d74d2d1d06433a4ef47284209009df8a authorKazu Yamamoto <kazu@iij.ad.jp> dateWed 16 Jul 2014, 12:20 (12 years ago) parenta2b66c9
1 file changed+7−7
auto-update/Control/AutoUpdate.hs+7−7
auto-update/Control/AutoUpdate.hs+7−7
@@ -136,14 +136,14 @@ getCurrent :: Int -- ^ frequency
136136 -> IO a -- ^ internal update action
137137 -> IORef (Status a) -- ^ mutable state
138138 -> IO a
139−getCurrent freq spawnThreshold action istatus = do
139+getCurrent freq spawnThreshold update istatus = do
140140 ea <- atomicModifyIORef' istatus increment
141141 case ea of
142142 Return a -> return a
143− Manual -> action
144− Spawn -> do
145− a <- action
146− tid <- forkIO $ spawn freq action istatus
143+ Manual -> update
144+ Spawn -> do
145+ a <- update
146+ tid <- forkIO $ spawn freq update istatus
147147 join $ atomicModifyIORef' istatus $ turnToAuto a tid
148148 return a
149149 where
@@ -161,9 +161,9 @@ getCurrent freq spawnThreshold action istatus = do
161161 ,throwTo old Replaced)
162162
163163spawn :: Int -> IO a -> IORef (Status a) -> IO ()
164−spawn freq action istatus = handle (onErr istatus) $ forever $ do
164+spawn freq update istatus = handle (onErr istatus) $ forever $ do
165165 threadDelay freq
166− a <- action
166+ a <- update
167167 join $ atomicModifyIORef' istatus $ turnToManual a
168168 where
169169 -- Normal case.