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

Commit 68a59e1c authored by Bart Van Assche's avatar Bart Van Assche
Browse files

init: Document the locking strategy in class ShutdownState



Let the compiler verify that shutdown_command_lock_ is held when
shutdown_command_ is accessed.

Bug: 266255006
Change-Id: Ibd05137ab65e20f247f35bbb2bb1865e05f51f41
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 16ab2b67
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <android-base/thread_annotations.h>
#include <fs_avb/fs_avb.h>
#include <fs_mgr_vendor_overlay.h>
#include <keyutils.h>
@@ -259,7 +260,7 @@ static class ShutdownState {

  private:
    std::mutex shutdown_command_lock_;
    std::string shutdown_command_;
    std::string shutdown_command_ GUARDED_BY(shutdown_command_lock_);
    bool do_shutdown_ = false;
} shutdown_state;