Skip to content

Commit

Permalink
Rewrite comment for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Sep 16, 2023
1 parent 3af1f71 commit 3bad774
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/kcas/kcas.ml
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,9 @@ let[@inline] rec cas_with_state loc before state state_old =
true
end
else
(* We must retry, because compare is by value rather than by state.
Because we don't usually change location state on no-op updates (to
avoid unnecessary wakeups), we should mostly fail spuriously due to
some other thread having installed or removed a waiter.
(* We must retry, because compare is by value rather than by state. In
other words, we should not fail spuriously due to some other thread
having installed or removed a waiter.
Fenceless is safe as there was a fence before. *)
cas_with_state loc before state (fenceless_get (as_atomic loc)))
Expand Down

0 comments on commit 3bad774

Please sign in to comment.