git-annex/Assistant/BranchChange.hs

23 lines
628 B
Haskell
Raw Normal View History

{- git-annex assistant git-annex branch change tracking
-
- Copyright 2012 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Assistant.BranchChange where
import Control.Concurrent.MSampleVar
import Common.Annex
2012-10-24 17:15:31 +00:00
newtype BranchChangeHandle = BranchChangeHandle (MSampleVar ())
newBranchChangeHandle :: IO BranchChangeHandle
2012-10-24 17:15:31 +00:00
newBranchChangeHandle = BranchChangeHandle <$> newEmptySV
branchChanged :: BranchChangeHandle -> IO ()
2012-10-24 17:15:31 +00:00
branchChanged (BranchChangeHandle h) = writeSV h ()
waitBranchChange :: BranchChangeHandle -> IO ()
2012-10-24 17:15:31 +00:00
waitBranchChange (BranchChangeHandle h) = readSV h