diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-01-30 10:01:16 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-01-30 10:25:53 +0100 |
| commit | a05981ad286207910333873d6ed1aeed78423cc7 (patch) | |
| tree | 525ab154a6149eb8f7120adc57d3c74d7f82f858 /src/process | |
| parent | dc9ae6e351118818432be0430115bfbf77680e37 (diff) | |
| download | mullvadvpn-a05981ad286207910333873d6ed1aeed78423cc7.tar.xz mullvadvpn-a05981ad286207910333873d6ed1aeed78423cc7.zip | |
Change spawner generic to S
Diffstat (limited to 'src/process')
| -rw-r--r-- | src/process/monitor.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/process/monitor.rs b/src/process/monitor.rs index 92960f7356..a9d6c0b36b 100644 --- a/src/process/monitor.rs +++ b/src/process/monitor.rs @@ -86,16 +86,16 @@ struct RunningState<C: MonitoredChild> { /// A child process monitor. Takes care of starting and monitoring a child process and runs the /// listener on child exit. -pub struct ChildMonitor<B: ChildSpawner> { - spawner: B, - state: Arc<Mutex<State<B::Child>>>, +pub struct ChildMonitor<S: ChildSpawner> { + spawner: S, + state: Arc<Mutex<State<S::Child>>>, } -impl<B: ChildSpawner> ChildMonitor<B> { +impl<S: ChildSpawner> ChildMonitor<S> { /// Creates a new `ChildMonitor` that spawns processes with the given `spawner`. The new /// `ChildMonitor` will be in the stopped state and not start any process until you call /// `start()`. - pub fn new(spawner: B) -> Self { + pub fn new(spawner: S) -> Self { ChildMonitor { spawner: spawner, state: Arc::new(Mutex::new(State::Stopped)), @@ -124,7 +124,7 @@ impl<B: ChildSpawner> ChildMonitor<B> { } } - fn spawn_monitor<L>(&self, child: B::Child, mut listener: L) -> thread::JoinHandle<()> + fn spawn_monitor<L>(&self, child: S::Child, mut listener: L) -> thread::JoinHandle<()> where L: FnMut(bool) + Send + 'static { let state_mutex = self.state.clone(); @@ -150,7 +150,7 @@ impl<B: ChildSpawner> ChildMonitor<B> { } } -impl<B: ChildSpawner> Drop for ChildMonitor<B> { +impl<S: ChildSpawner> Drop for ChildMonitor<S> { fn drop(&mut self) { let thread_handle = { let mut state_lock = self.state.lock().unwrap(); |
