Skip to content

fix setRate & setPeriod visibility problem#46

Open
leoxiao2012 wants to merge 1 commit intoPhantomThief:masterfrom
leoxiao2012:fix-rate-limiter
Open

fix setRate & setPeriod visibility problem#46
leoxiao2012 wants to merge 1 commit intoPhantomThief:masterfrom
leoxiao2012:fix-rate-limiter

Conversation

@leoxiao2012
Copy link

'setRate' & 'setPeriod' only changed non-volatile variable 'allowTimesPerNanos' which might be invisible to other threads. (it didn't pass the newly added tests. Writing volatile 'lastAcquiredNanos' to zero will fix it.

@leoxiao2012 leoxiao2012 marked this pull request as ready for review October 18, 2022 09:29
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.

1 participant