[Git][ghc/ghc][master] base: Update description of locking behavior
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Wed Jan 29 07:29:40 UTC 2025
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
944712da by Ben Gamari at 2025-01-29T02:29:13-05:00
base: Update description of locking behavior
- - - - -
1 changed file:
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock.hs
Changes:
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock.hs
=====================================
@@ -35,14 +35,20 @@ import GHC.Internal.IO.Handle.Lock.NoOp
--
-- Things to be aware of:
--
--- 1) This function may block inside a C call. If it does, in order to be able
+-- 1. This function may block inside a C call. If it does, in order to be able
-- to interrupt it with asynchronous exceptions and/or for other threads to
-- continue working, you MUST use threaded version of the runtime system.
--
--- 2) The implementation uses 'LockFileEx' on Windows and 'flock' otherwise,
+-- 2. The implementation uses relies on any of a number of locking
+-- facilities, depending upon what the platform supports:
+--
+-- * 'LockFileEx' is used on Windows
+-- * On platforms that support it we use the @F_OFD_SETLK@ and @F_OFD_SETLKW@ @fnctl at s.
+-- * Otherwise we use @flock@
+--
-- hence all of their caveats also apply here.
--
--- 3) On non-Windows platforms that don't support 'flock' (e.g. Solaris) this
+-- 3. On non-Windows platforms that don't support 'flock' (e.g. Solaris) this
-- function throws 'FileLockingNotImplemented'. We deliberately choose to not
-- provide fcntl based locking instead because of its broken semantics.
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/944712dad749f39d087b868d8e5c2126601994f9
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/944712dad749f39d087b868d8e5c2126601994f9
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/20250129/13ae90b1/attachment-0001.html>
More information about the ghc-commits
mailing list