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
Add fairness
option to KeyedLock.
#10703
Conversation
@@ -75,6 +77,58 @@ public void checkIfMapEmptyAfterLotsOfAcquireAndReleases() throws InterruptedExc | |||
} | |||
} | |||
|
|||
public void checkIfFairLockingWorks() throws InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what this test tests to be honest but we only pass the param on so no need to really test it. the randomization up there is fine.
it looks ok to me but may I ask what triggered this change? |
I have a use case for guaranteed order of execution.I'm seeing this test intermittently fail on my build so I'm investigating. |
ok I see - please remove this test though we are not testing JDK functionality - the randomization is fine |
Can I merge this to 1.x and 1.5? |
8045210
to
8bd1585
Compare
please squash and push to all relevant branches. 1.5 is bugfix only so please only to 1.x and master |
@GaelTadh ping |
38c8766
to
3ad279b
Compare
This change adds the ability of a
KeyedLock
to befair
this means that threads will aquire the lock in the order they ask for it.Also add a test to ensure the fairness parameter is obeyed.