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

Commit 9744d622 authored by Olivier Gaillard's avatar Olivier Gaillard Committed by Android (Google) Code Review
Browse files

Merge "Add thread to check for lock contention."

parents cfcaa507 7ad419a4
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -390,11 +390,16 @@ public class Watchdog {
        // potentially hold longer running operations with no guarantees about the timeliness
        // of operations there.
        //
        // The shared foreground thread is the main checker.  It is where we
        // will also dispatch monitor checks and do other work.
        mMonitorChecker = new HandlerChecker(FgThread.getHandler(),
                "foreground thread");
        // Use a custom thread to check monitors to avoid lock contention from impacted other
        // threads.
        ServiceThread t = new ServiceThread("watchdog.monitor",
                android.os.Process.THREAD_PRIORITY_DEFAULT, true /*allowIo*/);
        t.start();
        mMonitorChecker = new HandlerChecker(new Handler(t.getLooper()), "monitor thread");
        mHandlerCheckers.add(withDefaultTimeout(mMonitorChecker));

        mHandlerCheckers.add(withDefaultTimeout(
                new HandlerChecker(FgThread.getHandler(), "foreground thread")));
        // Add checker for main thread.  We only do a quick check since there
        // can be UI running on the thread.
        mHandlerCheckers.add(withDefaultTimeout(