Drop for TimeoutExecutor on win10 (#269)
* small fixes * update .gitignore
This commit is contained in:
parent
7ca7b3c9f6
commit
b6d22a2fbb
3
fuzzers/libfuzzer_stb_image/.gitignore
vendored
3
fuzzers/libfuzzer_stb_image/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
libpng-*
|
libpng-*
|
||||||
|
libfuzzer_stb_image
|
||||||
|
Binary file not shown.
@ -1,15 +1,16 @@
|
|||||||
use core::marker::PhantomData;
|
use core::marker::PhantomData;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use std::{process::Child, time::Duration};
|
use std::process::Child;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use crate::{
|
use crate::{executors::HasObservers, inputs::Input, observers::ObserversTuple, Error};
|
||||||
executors::{Executor, ExitKind, HasObservers},
|
|
||||||
inputs::Input,
|
#[cfg(all(feature = "std", unix))]
|
||||||
observers::ObserversTuple,
|
use crate::executors::{Executor, ExitKind};
|
||||||
Error,
|
|
||||||
};
|
#[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.
|
/// 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.
|
/// 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)>,
|
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
|
// this only works on unix because of the reliance on checking the process signal for detecting OOM
|
||||||
#[cfg(all(feature = "std", unix))]
|
#[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>
|
impl<EM, I, S, Z, T, OT> Executor<EM, I, S, Z> for CommandExecutor<EM, I, S, Z, T, OT>
|
||||||
|
@ -211,3 +211,10 @@ where
|
|||||||
self.executor.observers_mut()
|
self.executor.observers_mut()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
impl<E> Drop for TimeoutExecutor<E> {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
windows_delete_timer_queue(self.timer_queue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user