[Git][ghc/ghc][wip/jsem] subtract one in the right place

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Thu Sep 29 18:22:17 UTC 2022



Matthew Pickering pushed to branch wip/jsem at Glasgow Haskell Compiler / GHC


Commits:
b6149e21 by Matthew Pickering at 2022-09-29T19:22:07+01:00
subtract one in the right place

- - - - -


1 changed file:

- compiler/GHC/Driver/MakeSem.hs


Changes:

=====================================
compiler/GHC/Driver/MakeSem.hs
=====================================
@@ -211,7 +211,8 @@ cleanupJobserver (Jobserver { jSemaphore = sem
     logDumpMsg logger "cleanupJobserver {" $
       vcat [ text "about to release all owned semaphore tokens"
            , ppr jobs ]
-    tokens_before <- releaseSemaphore sem owned
+    -- (-1) because the caller of GHC is responsible for releasing the last slot on the semaphore.
+    tokens_before <- releaseSemaphore sem (owned - 1)
     logDumpMsg logger "cleanupJobserver }" $
       vcat [ text "released:" <+> ppr owned
            , text "semaphore count before release:" <+> ppr tokens_before ]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6149e21f4c4a326ad15975ea1fe75e1568afd48

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b6149e21f4c4a326ad15975ea1fe75e1568afd48
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20220929/3b8f6bbd/attachment.html>


More information about the ghc-commits mailing list