diff options
Diffstat (limited to 'Assistant/BranchChange.hs')
-rw-r--r-- | Assistant/BranchChange.hs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Assistant/BranchChange.hs b/Assistant/BranchChange.hs index cf7080f90..c9354544a 100644 --- a/Assistant/BranchChange.hs +++ b/Assistant/BranchChange.hs @@ -7,16 +7,13 @@ module Assistant.BranchChange where -import Control.Concurrent.MSampleVar -import Common.Annex - -newtype BranchChangeHandle = BranchChangeHandle (MSampleVar ()) +import Assistant.Common +import Assistant.Types.BranchChange -newBranchChangeHandle :: IO BranchChangeHandle -newBranchChangeHandle = BranchChangeHandle <$> newEmptySV +import Control.Concurrent.MSampleVar -branchChanged :: BranchChangeHandle -> IO () -branchChanged (BranchChangeHandle h) = writeSV h () +branchChanged :: Assistant () +branchChanged = flip writeSV () <<~ (fromBranchChangeHandle . branchChangeHandle) -waitBranchChange :: BranchChangeHandle -> IO () -waitBranchChange (BranchChangeHandle h) = readSV h +waitBranchChange :: Assistant () +waitBranchChange = readSV <<~ (fromBranchChangeHandle . branchChangeHandle) |