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

Commit c01b4568 authored by Michael Wright's avatar Michael Wright Committed by Android (Google) Code Review
Browse files

Merge "Watchdog race condition when sending message out of synchronized"

parents 097fc7ef 1d08e599
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -386,13 +386,11 @@ public class Watchdog extends Thread {
    public void run() {
        boolean waitedHalf = false;
        while (true) {
            mCompleted = false;
            mHandler.sendEmptyMessage(MONITOR);


            final String name;
            synchronized (this) {
                long timeout = TIME_TO_WAIT;
                mCompleted = false;
                mHandler.sendEmptyMessage(MONITOR);

                // NOTE: We use uptimeMillis() here because we do not want to increment the time we
                // wait while asleep. If the device is asleep then the thing that we are waiting