does `stopped` need to be `volatile` here to work?