Cancel flag must be volatile