From 4eb6b55e980fda9c4d260820f5a6d38dde3d0991 Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 8 Sep 2014 15:43:20 +0000 Subject: (1) Refactor concurrency, (2) write to .gfo.tmp then rename to .gfo (1) introduces the module GF.Infra.Concurreny with lifted concurrency operators (to reduce uses of liftIO) and some additional concurrency utilities, e.g. a function for sequential logging that is used in both GF.CompileInParallel and GFServer. (2) avoids leaving broken .gfo files behind if compilation is aborted. --- src/compiler/GFC.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compiler/GFC.hs') diff --git a/src/compiler/GFC.hs b/src/compiler/GFC.hs index 6f909b511..4b88bd998 100644 --- a/src/compiler/GFC.hs +++ b/src/compiler/GFC.hs @@ -83,7 +83,7 @@ unionPGFFiles opts fs = where checkFirst name = do let pgfFile = outputPath opts (name <.> "pgf") - sourceTime <- liftIO $ maximum `fmap` mapM getModificationTime fs + sourceTime <- maximum `fmap` mapM getModificationTime fs targetTime <- maybeIO $ getModificationTime pgfFile if targetTime >= Just sourceTime then putIfVerb opts $ pgfFile ++ " is up-to-date." -- cgit v1.2.3