You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
In class ServiceThread. The variables hasNotified has been declared as AtomicBoolean. This is ensure the visibility, whether can declared without the volatile?
protected volatile AtomicBoolean hasNotified = new AtomicBoolean(false);
Motivation
This maybe cause confuse when view the source code.
Describe the Solution You'd Like
protected AtomicBoolean hasNotified = new AtomicBoolean(false);
Describe Alternatives You've Considered
None.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
KimZhangJinMing
changed the title
[Enhancement] ServiceThread类中hasNotified是不是不需要volatile了?
[Enhancement] The variables hasNotified whether can declared without the volatile keyword?
Apr 26, 2024
Before Creating the Enhancement Request
Summary
In class ServiceThread. The variables hasNotified has been declared as AtomicBoolean. This is ensure the visibility, whether can declared without the volatile?
protected volatile AtomicBoolean hasNotified = new AtomicBoolean(false);
Motivation
This maybe cause confuse when view the source code.
Describe the Solution You'd Like
Describe Alternatives You've Considered
None.
Additional Context
No response
The text was updated successfully, but these errors were encountered: