Commit 7483bc15 authored by John McCutchan's avatar John McCutchan Committed by GitHub

Stop handling signals and terminal input separately (#9057)

Fixes #7307
parent 0b566b38
...@@ -175,20 +175,20 @@ abstract class ResidentRunner { ...@@ -175,20 +175,20 @@ abstract class ResidentRunner {
exit(0); exit(0);
} }
bool _processingSignal = false; bool _processingUserRequest = false;
Future<Null> _handleSignal(ProcessSignal signal) async { Future<Null> _handleSignal(ProcessSignal signal) async {
if (_processingSignal) { if (_processingUserRequest) {
printTrace('Ignoring signal: "$signal" because we are busy.'); printTrace('Ignoring signal: "$signal" because we are busy.');
return; return;
} }
_processingSignal = true; _processingUserRequest = true;
final bool fullRestart = signal == ProcessSignal.SIGUSR2; final bool fullRestart = signal == ProcessSignal.SIGUSR2;
try { try {
await restart(fullRestart: fullRestart); await restart(fullRestart: fullRestart);
} finally { } finally {
_processingSignal = false; _processingUserRequest = false;
} }
} }
...@@ -277,20 +277,18 @@ abstract class ResidentRunner { ...@@ -277,20 +277,18 @@ abstract class ResidentRunner {
return false; return false;
} }
bool _processingTerminalRequest = false;
Future<Null> processTerminalInput(String command) async { Future<Null> processTerminalInput(String command) async {
if (_processingTerminalRequest) { if (_processingUserRequest) {
printTrace('Ignoring terminal input: "$command" because we are busy.'); printTrace('Ignoring terminal input: "$command" because we are busy.');
return; return;
} }
_processingTerminalRequest = true; _processingUserRequest = true;
try { try {
final bool handled = await _commonTerminalInputHandler(command); final bool handled = await _commonTerminalInputHandler(command);
if (!handled) if (!handled)
await handleTerminalCommand(command); await handleTerminalCommand(command);
} finally { } finally {
_processingTerminalRequest = false; _processingUserRequest = false;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment