This is the base implementation of the Controller contract. It provides a an extensible implementation and two locking methods to handle the state machine robustly.
Note: Neither of these locks should be held during callouts to context lifecycle methods install/uninstall to avoid deadlocks.
provide a lock where no internal state is modified but you want a consistent view of the data.
provide a lock internal state is modified.