Ensure ObjectCleaner will also be used when FastThreadLocal.set is used.#7534
Closed
normanmaurer wants to merge 1 commit into4.1from
Closed
Ensure ObjectCleaner will also be used when FastThreadLocal.set is used.#7534normanmaurer wants to merge 1 commit into4.1from
normanmaurer wants to merge 1 commit into4.1from
Conversation
Motivation: e329ca1 introduced the user of ObjectCleaner in FastThreadLocal but we missed the case to register our cleaner task if FastThreadLocal.set was called only. Modifications: - Use ObjectCleaner also when FastThreadLocal.set is used. - Add test case. Result: ObjectCleaner is always used.
Member
Author
|
@zpencer PTAL |
zpencer
approved these changes
Dec 21, 2017
Scottmitch
reviewed
Dec 22, 2017
Member
Scottmitch
left a comment
There was a problem hiding this comment.
few comments but generally lgtm
| if (value != InternalThreadLocalMap.UNSET) { | ||
| set(InternalThreadLocalMap.get(), value); | ||
| InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get(); | ||
| boolean alreadySet = threadLocalMap.isIndexedVariableSet(index); |
Member
There was a problem hiding this comment.
consider making an overload of set which returns alreadySet because it already knows this information. it could be private static.
Member
Author
There was a problem hiding this comment.
This is not alway true... let me just merge it as it is for now
| */ | ||
| @SuppressWarnings("unchecked") | ||
| public final V get() { | ||
| final InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get(); |
Member
There was a problem hiding this comment.
was removing final intentional and for stylistic reasons?
Member
Author
There was a problem hiding this comment.
yeah I added it before when I needed it as I used it in the Runnable but as I moved this to an extra method I not need it anymore
Member
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
e329ca1 introduced the user of ObjectCleaner in FastThreadLocal but we missed the case to register our cleaner task if FastThreadLocal.set was called only.
Modifications:
Result:
ObjectCleaner is always used.