add the lock and Unlock of CastInst and GetElementPtrInst