-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Review Locker #4058
Comments
@sbordet You'll have to also support We can remove the @janbartel I think we should use this issue and resulting PR to cleanup the usage of |
Removes the Locker class, replaced by AutoLock. Removed usages of Locker.isLocked() from the session code since it was not necessary. Took the chance to do a little code cleanup. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Removes the Locker class, replaced by AutoLock. Removed usages of Locker.isLocked() from the session code since it was not necessary. Took the chance to do a little code cleanup. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Class
Locker
has an_unlock
field that is completely unnecessary, wasting memory and causing pointer chasing to callclose()
on it.Class
Locker.Lock
is notstatic
so it has a hidden field pointing back toLocker
increasing memory waste.I propose the introduction of a new class called
AutoLock
which implementsAutoCloseable
and returns itself:The idiom will change from:
to
This will require a large change in the codebase, but has the advantage that it will be as easy to use as
synchronized
and will play better for the future in case of Project Loom.The text was updated successfully, but these errors were encountered: