mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
LibLine: Defer handling SIGWINCH and SIGINT
Performing these immediately can introduce a race condition between the user's signal-related logic and LibLine's own, so defer the handlers to make sure they run when our terminal IO cannot interfere with the user's.
This commit is contained in:
parent
fb979dcf34
commit
7e5f1fa895
1 changed files with 2 additions and 2 deletions
|
@ -582,11 +582,11 @@ void Editor::initialize()
|
|||
|
||||
if (m_configuration.m_signal_mode == Configuration::WithSignalHandlers) {
|
||||
m_signal_handlers.append(Core::EventLoop::register_signal(SIGINT, [this](int) {
|
||||
interrupted().release_value_but_fixme_should_propagate_errors();
|
||||
Core::EventLoop::current().deferred_invoke([this] { interrupted().release_value_but_fixme_should_propagate_errors(); });
|
||||
}));
|
||||
|
||||
m_signal_handlers.append(Core::EventLoop::register_signal(SIGWINCH, [this](int) {
|
||||
resized().release_value_but_fixme_should_propagate_errors();
|
||||
Core::EventLoop::current().deferred_invoke([this] { resized().release_value_but_fixme_should_propagate_errors(); });
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue