Introducing a debug_lck for controlling concurrency