Improved StartContext and StopContext lock granularity