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

Commit 5c5a6bdc authored by Tao Wu's avatar Tao Wu Committed by android-build-merger
Browse files

Merge "Fix race condition between restart and stop/reset."

am: ee14225e

Change-Id: Ia49e967f5fb7fc58058c260fcad4559b2a4df15d
parents a4e1f243 ee14225e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -960,6 +960,13 @@ void Service::StopOrReset(int how) {
    } else {
        flags_ |= how;
    }
    // Make sure it's in right status when a restart immediately follow a
    // stop/reset or vice versa.
    if (how == SVC_RESTART) {
        flags_ &= (~(SVC_DISABLED | SVC_RESET));
    } else {
        flags_ &= (~SVC_RESTART);
    }

    if (pid_) {
        KillProcessGroup(SIGKILL);