pub fn stop(&mut self) -> Result<(), GarbageCollectorError> {
        self.state
            .lock()
            .map(|mut state| {
                state.running = false;
            })
            .map_err(|_| GarbageCollectorError::LockError)?;
        if let Some(thread) = self.thread.take() {
            thread
                .join()
                .map_err(|_| GarbageCollectorError::JoinError)?;
        }
        Ok(())
    }
/// Stop & join the collector thread.
Stop & join the collector thread.
Stop & join the collector thread .
pub fn stop(&mut self) -> Result<(), GarbageCollectorError> {
        self.state
            .lock()
            .map(|mut state| {
                state.running = false;
            })
            .map_err(|_| GarbageCollectorError::LockError)?;
        if let Some(thread) = self.thread.take() {
            thread
                .join()
                .map_err(|_| GarbageCollectorError::JoinError)?;
        }
        Ok(())
    }
pub fn stop ( & mut self ) -> Result < ( ) , GarbageCollectorError > { self . state . lock ( ) . map ( | mut state | { state . running = false ; } ) . map_err ( | _ | GarbageCollectorError :: LockError ) ? ; if let Some ( thread ) = self . thread . take ( ) { thread . join ( ) . map_err ( | _ | GarbageCollectorError :: JoinError ) ? ; } Ok ( ( ) ) }
Stop & join the collector thread.
Stop & join the collector thread .
&mut self
&mut self