Use double-checked locking in (Java) Singleton type
Avoid unnecessary locks in the common case where the singleton has been initialized. This is achieved through double-checked locking with the volatile instance member. Bug: 411249866 Test: atest FrameworksCoreTests Flag: EXEMPT basic performance bugfix Change-Id: I89b60ab6b6fd72eb598f5bfa9d3081a78bc10889
Loading
Please register or sign in to comment