summaryrefslogtreecommitdiff
path: root/tools/aapt2/diff/Diff.cpp
diff options
context:
space:
mode:
authorHugo Benichi <hugobenichi@google.com>2016-10-13 16:48:42 +0900
committerLorenzo Colitti <lorenzo@google.com>2017-01-18 19:08:23 +0900
commit0f1f54d4d129fb3c2272c59aa9b88b3547ea5030 (patch)
tree23eca47d1d2a5c0c392aab43c9b0bab36ce28853 /tools/aapt2/diff/Diff.cpp
parente804d3773cb4fed2c40d43edb38fc2f0c94b2a3c (diff)
DO NOT MERGE: ConnectivityThread: use lazy holder idiom
This patch changes the way that the ConnectivityThread is lazily instantiated by using the "lazy initialization holder class idiom". The first code point that tries to obtain a reference to the unique ConnectivityThread instance will trigger the creation of the Singleton class, which will guarantee a thread-safe initialization of the static INSTANCE field inside Singleton according to the language specs. This is the Item #71 of Effective Java. The unique static instance of ConnectivityThread is not stored directly inside ConnectivityThread class but is stored in a static nested class. This is to avoid triggering the creation of that unique instance when Zygote does class preloading at phone startup. Otherwise this would lead to Zygote creating a new OS thread during preloading, which is a fatal error. Test: frameworks-wifi tests pass Bug: 26749700 Bug: 28537383 Bug: 32130437 (cherry picked from commit c4fe5d373caa9f53686e4d58e61394dd40558957) (cherry picked from commit ce765b7a51d9452aaa32e43bedeefb7ad200df52) Change-Id: Ic9a31809ef19e618246f9aa17f5df29bd65f8510
Diffstat (limited to 'tools/aapt2/diff/Diff.cpp')
0 files changed, 0 insertions, 0 deletions