Merge "Introduce new lock to avoid lock-ordering issues." into sc-dev