Add multi-thread lock on the basic block