switch PCX to MVar for easier reasoning about safe concurrency