I added a mutex here to start using this instead of spin loops, it's time we stop doing that.