mirror of
https://github.com/joleuger/vuinputd.git
synced 2026-07-17 16:36:03 +00:00
Notify all pending waiters on close
This commit is contained in:
parent
152ffd9711
commit
aea990946d
1 changed files with 10 additions and 0 deletions
|
|
@ -137,6 +137,16 @@ impl PollState {
|
|||
}
|
||||
}
|
||||
|
||||
impl Drop for PollState {
|
||||
fn drop(&mut self) {
|
||||
//when the device closes, notify all pending waiters
|
||||
let old_handle = self.take_waiters();
|
||||
if let Some(mut old_handle) = old_handle {
|
||||
old_handle.notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct VuInputState {
|
||||
pub file: File,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue