Clear input thread channel on restore()
The channel may contain Kill commands that will cause the new thread to exit immediately.memfd
parent
65666e6695
commit
7807f565ec
|
@ -52,6 +52,10 @@ struct InputHandler {
|
||||||
|
|
||||||
impl InputHandler {
|
impl InputHandler {
|
||||||
fn restore(&self, tx: Sender<ThreadEvent>) {
|
fn restore(&self, tx: Sender<ThreadEvent>) {
|
||||||
|
/* Clear channel without blocking. switch_to_main_screen() issues a kill when
|
||||||
|
* returning from a fork and there's no input thread, so the newly created thread will
|
||||||
|
* receive it and die. */
|
||||||
|
let _ = self.rx.try_iter().count();
|
||||||
let rx = self.rx.clone();
|
let rx = self.rx.clone();
|
||||||
thread::Builder::new()
|
thread::Builder::new()
|
||||||
.name("input-thread".to_string())
|
.name("input-thread".to_string())
|
||||||
|
|
Loading…
Reference in New Issue