Make org.chromium.chromecast.base.Unit thread-safe.
It had race condition on unsynchronized access to static field. Fixed it
by using clinit (static initializer). Other typical pattern for
singletons would be "enum MyType {INSTANCE;}".
Bug: None.
Change-Id: I421e0b9f56ef1184194be2a4e083da7e06ab114c
Reviewed-on: https://chromium-review.googlesource.com/c/1333470Reviewed-by:
Simeon Anfinrud <sanfin@chromium.org>
Commit-Queue: Jan Lamecki <jachor@google.com>
Cr-Commit-Position: refs/heads/master@{#607973}
Showing
Please register or sign in to comment