This `unsafe` block can probably get removed with the new mutexes (they're not unsafe to create).