diff options
| author | 2012-12-19 15:04:21 -0800 | |
|---|---|---|
| committer | 2013-01-02 13:25:57 -0800 | |
| commit | 5cd731a2333479d85b1bdf6dbf8a185df2877146 (patch) | |
| tree | 645965fde2ab7343fe892cd3c9f4a71c94cd69b7 /libs/hwui/GradientCache.cpp | |
| parent | 4c7f809dd5c934b86b0450e59941998aeb7fb96e (diff) | |
prevent concurrency issues during LocationManager init
systemReady() was returning before the LocationManagerService was
actually ready. Applications making LocationManager transactions
during their startup could possibly hit a race condition with the
yet-uninitialised LocationManagerService.
To guarantee that LocationManagerService is actually ready before
returning from systemReady(), we simply do the startup work on the
thread that called systemReady(), rather than spin up a secondary
thread to do the work asynchronously.
LocationWorkerHandler still needs a thread to do its work on, so
rather than have it run on the secondary thread that was
previously used for systemReady()'s work, we create a HandlerThread
for it.
Additionally, LocationManagerService.init() really needed to grab
lock for some of the things it was doing. I moved all of the code
that could benefit from mutex protection to a single section of
systemReady() and wrapped it up with a lock while I was at it.
Bug: 7723944
Change-Id: I51d480e2781622c3a14769c3a2019a2407dcfd8a
Diffstat (limited to 'libs/hwui/GradientCache.cpp')
0 files changed, 0 insertions, 0 deletions