Drop for TimeoutExecutor on win10 (#269)

* small fixes

* update .gitignore
This commit is contained in:
Toka 2021-08-19 16:11:16 +09:00 committed by GitHub
parent 7ca7b3c9f6
commit b6d22a2fbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 8 deletions

View File

@ -1 +1,2 @@
libpng-*
libfuzzer_stb_image

View File

@ -1,15 +1,16 @@
use core::marker::PhantomData;
#[cfg(feature = "std")]
use std::{process::Child, time::Duration};
use std::process::Child;
#[cfg(feature = "std")]
use crate::{
executors::{Executor, ExitKind, HasObservers},
inputs::Input,
observers::ObserversTuple,
Error,
};
use crate::{executors::HasObservers, inputs::Input, observers::ObserversTuple, Error};
#[cfg(all(feature = "std", unix))]
use crate::executors::{Executor, ExitKind};
#[cfg(all(feature = "std", unix))]
use std::time::Duration;
/// A `CommandExecutor` is a wrapper around [`std::process::Command`] to execute a target as a child process.
/// Construct a `CommandExecutor` by implementing [`CommandConfigurator`] for a type of your choice and calling [`CommandConfigurator::into_executor`] on it.
@ -19,6 +20,12 @@ pub struct CommandExecutor<EM, I, S, Z, T, OT> {
phantom: PhantomData<(EM, I, S, Z)>,
}
impl<EM, I, S, Z, T, OT> CommandExecutor<EM, I, S, Z, T, OT> {
pub fn inner(&mut self) -> &mut T {
&mut self.inner
}
}
// this only works on unix because of the reliance on checking the process signal for detecting OOM
#[cfg(all(feature = "std", unix))]
impl<EM, I, S, Z, T, OT> Executor<EM, I, S, Z> for CommandExecutor<EM, I, S, Z, T, OT>

View File

@ -211,3 +211,10 @@ where
self.executor.observers_mut()
}
}
#[cfg(windows)]
impl<E> Drop for TimeoutExecutor<E> {
fn drop(&mut self) {
windows_delete_timer_queue(self.timer_queue);
}
}