summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Ben Gamari <bgamari.foss@gmail.com>2012-10-05 17:03:58 -0400
committerGravatar Ben Gamari <bgamari.foss@gmail.com>2012-10-05 17:03:58 -0400
commit9722f498c21498f88225e0b5d53229221a99e87d (patch)
treea5a762764e73354b4161cd0b78755cfcc0effb61 /Remote/Git.hs
parentd8087d187dfa7b8b9d19085d05533ed203131bdc (diff)
Remote/Git: Use SampleVar from SafeSemaphore instead of base
SampleVars from base are unsafe
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index df97db7a6..6d95d5de0 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -38,6 +38,7 @@ import Types.Key
import qualified Fields
import Control.Concurrent
+import Control.Concurrent.MSampleVar
import System.Process (std_in, std_err)
remote :: RemoteType
@@ -273,9 +274,9 @@ copyFromRemote r key file dest
: maybe [] (\f -> [(Fields.associatedFile, f)]) file
Just (cmd, params) <- git_annex_shell r "transferinfo"
[Param $ key2file key] fields
- v <- liftIO $ newEmptySampleVar
+ v <- liftIO $ newEmptySV
tid <- liftIO $ forkIO $ void $ tryIO $ do
- bytes <- readSampleVar v
+ bytes <- readSV v
p <- createProcess $
(proc cmd (toCommand params))
{ std_in = CreatePipe
@@ -288,8 +289,8 @@ copyFromRemote r key file dest
hFlush h
send bytes
forever $
- send =<< readSampleVar v
- let feeder = writeSampleVar v
+ send =<< readSV v
+ let feeder = writeSV v
bracketIO noop (const $ tryIO $ killThread tid) (a feeder)
copyFromRemoteCheap :: Git.Repo -> Key -> FilePath -> Annex Bool