Use CSingleLock to lock.