From 7af36afe5f8ad66ce5195bfa236ae3cab811f527 Mon Sep 17 00:00:00 2001 From: Nikolas Havrikov Date: Mon, 9 Jan 2023 15:01:56 +0000 Subject: [PATCH] Remove moot synchronization on shutdown Currently, the call to rebootOrShutdown is synchronized on the Runnable.this instance, and thus there is no way for any other thread to contend on the same lock. Change-Id: Idaacda47031431435598dfd45840b1344c5938e6 Test: manually --- services/java/com/android/server/SystemServer.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 5b9460a226bb9..2c84ea31a41f0 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -1020,9 +1020,7 @@ public final class SystemServer implements Dumpable { Runnable runnable = new Runnable() { @Override public void run() { - synchronized (this) { - ShutdownThread.rebootOrShutdown(null, reboot, reason); - } + ShutdownThread.rebootOrShutdown(null, reboot, reason); } };