From 7483bc153dc3fde858f9bf301cc4cdbfc0c0d726 Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Wed, 29 Mar 2017 06:46:27 -0700 Subject: [PATCH] Stop handling signals and terminal input separately (#9057) Fixes #7307 --- .../flutter_tools/lib/src/resident_runner.dart | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 6023ef4f8a..0a88e13b2e 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -175,20 +175,20 @@ abstract class ResidentRunner { exit(0); } - bool _processingSignal = false; + bool _processingUserRequest = false; Future _handleSignal(ProcessSignal signal) async { - if (_processingSignal) { + if (_processingUserRequest) { printTrace('Ignoring signal: "$signal" because we are busy.'); return; } - _processingSignal = true; + _processingUserRequest = true; final bool fullRestart = signal == ProcessSignal.SIGUSR2; try { await restart(fullRestart: fullRestart); } finally { - _processingSignal = false; + _processingUserRequest = false; } } @@ -277,20 +277,18 @@ abstract class ResidentRunner { return false; } - bool _processingTerminalRequest = false; - Future processTerminalInput(String command) async { - if (_processingTerminalRequest) { + if (_processingUserRequest) { printTrace('Ignoring terminal input: "$command" because we are busy.'); return; } - _processingTerminalRequest = true; + _processingUserRequest = true; try { final bool handled = await _commonTerminalInputHandler(command); if (!handled) await handleTerminalCommand(command); } finally { - _processingTerminalRequest = false; + _processingUserRequest = false; } }