Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c944f1e4 authored by Tim Murray's avatar Tim Murray
Browse files

WindowProcessController: optimize locking

No need to lock if isCached is true. Move to mGlobalLockWithoutBoost to
avoid priority inheritance overhead.

Test: boots, works
Bug: 155924232
Change-Id: Iadf6fb14088a71f21ce015c014516bf07235a96e
parent f7b69012
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -1315,15 +1315,18 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
     *
     * @param isCached whether or not the process is cached.
     */
    @HotPath(caller = HotPath.OOM_ADJUSTMENT)
    public void onProcCachedStateChanged(boolean isCached) {
        synchronized (mAtm.mGlobalLock) {
            if (!isCached && mPendingConfiguration != null) {
        if (!isCached) {
            synchronized (mAtm.mGlobalLockWithoutBoost) {
                if (mPendingConfiguration != null) {
                    final Configuration config = mPendingConfiguration;
                    mPendingConfiguration = null;
                    dispatchConfigurationChange(config);
                }
            }
        }
    }

    /**
     * Called to notify {@link WindowProcessController} of a started service.