Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the right flags when Shared is selected. #9130

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

Leonidas-from-XIV
Copy link
Collaborator

exclusive selects between LOCK_EX and LOCK_SH but if it is false LOCK_SH is never set on the flags. This could've worked if LOCK_SH is 0 but at least on GNU/Linux on amd64 with glibc, LOCK_SH is 1.

We never use Shared in the Dune codebase but in case we would, it better works otherwise it would create issues that are hard to debug.

Discovered by @emillon as we were investigating the semantics of write locks.

`exclusive` selects between `LOCK_EX` and `LOCK_SH` but if it is `false`
`LOCK_SH` is never set on the flags. This could've worked if `LOCK_SH`
is `0` but at least on GNU/Linux on amd64 with glibc, `LOCK_SH` is `1`.

We never use `Shared` in the Dune codebase but in case we would, it
better works otherwise it would create issues that are hard to debug.

Discovered by @emillon as we were investigating the semantics of write
locks.

Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV Leonidas-from-XIV merged commit eb0d51e into ocaml:main Nov 10, 2023
24 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the shared-flock-fix branch November 10, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants