Acquire the lock in wxProgressDialog::DoNativeBeforeUpdate() itself instead of relying on the caller to do it. This is just a refactoring in preparation for further changes.