Improve UNIX signal handling (#518)

There was a dead lock caused by the reentrancy of the post method.

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
mr-mocap
2022-12-01 16:56:35 -05:00
committed by GitHub
parent 05f29ff3b3
commit f21ca3aa14
2 changed files with 140 additions and 72 deletions

View File

@@ -52,6 +52,8 @@ class ScreenInteractive : public Screen {
Closure WithRestoredIO(Closure);
private:
void ExitNow();
void Install();
void Uninstall();
@@ -64,8 +66,9 @@ class ScreenInteractive : public Screen {
void HandleTask(Component component, Task& task);
void Draw(Component component);
void ResetCursorPosition();
void SigStop();
void Signal(int signal);
ScreenInteractive* suspended_screen_ = nullptr;
enum class Dimension {
@@ -106,7 +109,7 @@ class ScreenInteractive : public Screen {
public:
class Private {
public:
static void SigStop(ScreenInteractive& s) { return s.SigStop(); }
static void Signal(ScreenInteractive& s, int signal) { s.Signal(signal); }
};
friend Private;
};