mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
ssh_terminal: fixed race condition during startup
Moved creating ssh loop thread after initialization of wake up server file descriptors to make sure that they will be properly handled even in first loop run. Issue #4095
This commit is contained in:
parent
b3a229eebb
commit
0b641ba581
@ -117,11 +117,6 @@ Ssh::Server::Server(Genode::Env &env,
|
||||
throw Init_failed();
|
||||
}
|
||||
|
||||
if (pthread_create(&_event_thread, nullptr, _server_loop, this)) {
|
||||
Genode::error("could not create event thread");
|
||||
throw Init_failed();
|
||||
}
|
||||
|
||||
/* add pipe to wake up loop on late connecting terminal */
|
||||
if (pipe(_server_fds) ||
|
||||
ssh_event_add_fd(_event_loop,
|
||||
@ -133,6 +128,11 @@ Ssh::Server::Server(Genode::Env &env,
|
||||
throw -1;
|
||||
}
|
||||
|
||||
if (pthread_create(&_event_thread, nullptr, _server_loop, this)) {
|
||||
Genode::error("could not create event thread");
|
||||
throw Init_failed();
|
||||
}
|
||||
|
||||
Genode::log("Listen on port: ", _port);
|
||||
}); /* Libc::with_libc */
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user