I’m not too sure regarding the lock. Are you running on Windows? I vaguely remember having some issues on Windows but I switched to Linux which has the same sampling speed but faster compilation in my experience.
If you are on Windows you could attempt to use WSL.