modifyState
Modifies the state variable safely, and with the correct observe behavior.
Synchronized to avoid concurrency issues, and make this operation atomic. Otherwise, one update may be lost if they are done in parallel.
Modifies the state variable safely, and with the correct observe behavior.
Synchronized to avoid concurrency issues, and make this operation atomic. Otherwise, one update may be lost if they are done in parallel.