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

Commit b6b7ccc2 authored by Bart Van Assche's avatar Bart Van Assche
Browse files

init: Document the locking strategy used in class PropWaiterState



Let the compiler verify that lock_ is held when any of the data members
are accessed.

Bug: 266255006
Change-Id: I71b341815d84ab530627d934ad4d4681b652b9d8
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 68a59e1c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -212,16 +212,16 @@ static class PropWaiterState {
    }

  private:
    void ResetWaitForPropLocked() {
    void ResetWaitForPropLocked() EXCLUSIVE_LOCKS_REQUIRED(lock_) {
        wait_prop_name_.clear();
        wait_prop_value_.clear();
        waiting_for_prop_.reset();
    }

    std::mutex lock_;
    std::unique_ptr<Timer> waiting_for_prop_{nullptr};
    std::string wait_prop_name_;
    std::string wait_prop_value_;
    GUARDED_BY(lock_) std::unique_ptr<Timer> waiting_for_prop_{nullptr};
    GUARDED_BY(lock_) std::string wait_prop_name_;
    GUARDED_BY(lock_) std::string wait_prop_value_;

} prop_waiter_state;