Skip to content

Commit

Permalink
Fix fast lock on windows (reassignment oldval)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamayama authored and shirok committed Oct 30, 2023
1 parent 1f6757f commit c9334bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -2977,6 +2977,8 @@ int Scm__WinFastLockLock(ScmInternalFastlock spin)
if (spin != NULL) {
ScmAtomicVar idle = 0;
while (!AO_compare_and_swap_full(&spin->lock_state, idle, 1)) {
/* idle might be changed */
idle = 0;
/* it might be slow */
Sleep(0);
}
Expand Down

0 comments on commit c9334bc

Please sign in to comment.