-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
TemporaryThreadLocals
AutoClosable
to safely use shared reso…
…urces (#3505) Motivation: - When a developer want to use shared resources in `TemporaryThreadLocals`, it is hard to ensure whether there is nested use to cause a corruption. Modifications: - Make `TemporaryThreadLocals` `AutoClosable` with lock. - Rename `TemporaryThreadLocals.get()` to `TemporaryThreadLocals.acquire()` with `@MustBeClosed` annotation. - Apply try-with-resources statement to `TemporaryThreadLocals.acquire()` usages. - nit. Fix the order about methods in `TemporaryThreadLocals`. Result: - If a developer try to use before releasing the resource, `IllegalStateException` occurs. - Not only a developer, but also reviewers feel easy to use without concerns.
- Loading branch information
Showing
29 changed files
with
682 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.