Skip to content
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

fix: Double-checked locking for logConstructor #3154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qingbozhang
Copy link

@qingbozhang qingbozhang commented May 2, 2024

When the tryImplementation method is called concurrently, the value of logConstructor may be overwritten. So I'm going to use DCL to solve this problem.

@harawata
Copy link
Member

harawata commented May 3, 2024

Thank you for the PR, @qingbozhang .

We have just eliminated synchronized blocks ( #3017 ).
Besides, enclosing Runnable#run() in synchronized may not achieve anything.

Are you actually experiencing some problem?
If so, please provide information for how to reproduce the problem.

@qingbozhang
Copy link
Author

Not yet. It just happen in theory.
I see ( #3017 ).
I can use lock field replace synchronized if necessary, and I can close this PR if not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants