Yes,
that's how is working. The state is persisted in a centralized database that is using optimistic locking. So, two threads can access to the state, but if they want to change it one of them will fail.. and you will need to retry that, the other one will be applied, keeping the state consistent all the time.
Cheers