See Frame Locking.
Lock acquires a non-exclusive lock on the current frame, such that the frame will not complete until the lock is released via Unlock. This also ensures that the host application (e.g. game) is not making modifications to relevant game objects.
There must be one unlock call per lock call.
Fully Qualified Name
static public void Lock();