REF use when luke
This commit is contained in:
parent
0ba68a457b
commit
e8cf056301
|
@ -97,9 +97,7 @@ waitAndKill tag pid = waitUntilExit pidDir
|
||||||
withUniquePid :: WatchedPIDs -> Pid -> IO () -> IO ()
|
withUniquePid :: WatchedPIDs -> Pid -> IO () -> IO ()
|
||||||
withUniquePid curPIDs pid f = do
|
withUniquePid curPIDs pid f = do
|
||||||
pids <- readMVar curPIDs
|
pids <- readMVar curPIDs
|
||||||
if pid `elem` pids
|
unless (pid `elem` pids) $ do
|
||||||
then return ()
|
modifyMVar_ curPIDs (return . (pid:))
|
||||||
else do
|
f
|
||||||
modifyMVar_ curPIDs (return . (pid:))
|
modifyMVar_ curPIDs (return . filter (/=pid))
|
||||||
f
|
|
||||||
modifyMVar_ curPIDs (return . filter (/=pid))
|
|
||||||
|
|
Loading…
Reference in New Issue