Changed control variable to mutex, to help with inanition.