Skip to content

Introduce Lock utility. #2944

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

Closed
wants to merge 1 commit into from
Closed

Introduce Lock utility. #2944

wants to merge 1 commit into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Sep 27, 2023

The Lock utility is an adapter for Java's Lock and ReadWrite Lock types providing an easier to consume programming model (callback-style and try-with-resources).

This effort is inspired by repetitive lock.lock(), try{} finally{lock.unlock();} usage where it is too simple to miss an unlock call.

@mp911de
Copy link
Member Author

mp911de commented Sep 27, 2023

See spring-projects/spring-data-mongodb#4431 for more usage examples.

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 27, 2023
The Lock utility is an adapter for Java's Lock and ReadWrite Lock types providing an easier to consume programming model (callback-style and try-with-resources).
@mp911de
Copy link
Member Author

mp911de commented Sep 29, 2023

Done. Rebased because of changes on main.

@gregturn gregturn self-requested a review October 4, 2023 13:50
@gregturn
Copy link
Contributor

gregturn commented Oct 4, 2023

Looks excellent.

@christophstrobl christophstrobl added this to the 3.2 RC1 (2023.1.0) milestone Oct 5, 2023
@mp911de mp911de deleted the lock-utils branch November 4, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants