pub fn wait_merging_threads(mut self) -> Result<()> {
        // this will stop the indexing thread,
        // dropping the last reference to the segment_updater.
        drop(self.operation_sender);

        let former_workers_handles = mem::replace(&mut self.workers_join_handle, vec![]);
        for join_handle in former_workers_handles {
            join_handle
                .join()
                .expect("Indexing Worker thread panicked")
                .map_err(|_| {
                    TantivyError::ErrorInThread("Error in indexing worker thread.".into())
                })?;
        }
        drop(self.workers_join_handle);

        let result = self
            .segment_updater
            .wait_merging_thread()
            .map_err(|_| TantivyError::ErrorInThread("Failed to join merging thread.".into()));

        if let Err(ref e) = result {
            error!("Some merging thread failed {:?}", e);
        }

        result
    }
/// If there are some merging threads, blocks until they all finish their work and
/// then drop the `IndexWriter`.
If there are some merging threads, blocks until they all finish their work and
then drop the `IndexWriter`.
If there are some merging threads blocks until they all finish their work and then drop the ` IndexWriter ` .
pub fn wait_merging_threads(mut self) -> Result<()> {
        // this will stop the indexing thread,
        // dropping the last reference to the segment_updater.
        drop(self.operation_sender);
        let former_workers_handles = mem::replace(&mut self.workers_join_handle, vec![]);
        for join_handle in former_workers_handles {
            join_handle
                .join()
                .expect("Indexing Worker thread panicked")
                .map_err(|_| {
                    TantivyError::ErrorInThread("Error in indexing worker thread.".into())
                })?;
        }
        drop(self.workers_join_handle);
        let result = self
            .segment_updater
            .wait_merging_thread()
            .map_err(|_| TantivyError::ErrorInThread("Failed to join merging thread.".into()));
        if let Err(ref e) = result {
            error!("Some merging thread failed {:?}", e);
        }
        result
    }
pub fn wait_merging_threads ( mut self ) -> Result < ( ) > { // this will stop the indexing thread, // dropping the last reference to the segment_updater. drop ( self . operation_sender ) ; let former_workers_handles = mem :: replace ( & mut self . workers_join_handle , vec ! [ ] ) ; for join_handle in former_workers_handles { join_handle . join ( ) . expect ( " " ) . map_err ( | _ | { TantivyError :: ErrorInThread ( " " . into ( ) ) } ) ? ; } drop ( self . workers_join_handle ) ; let result = self . segment_updater . wait_merging_thread ( ) . map_err ( | _ | TantivyError :: ErrorInThread ( " " . into ( ) ) ) ; if let Err ( ref e ) = result { error ! ( " " e ) ; } result }
If there are some merging threads, blocks until they all finish their work and
then drop the `IndexWriter`.
If there are some merging threads blocks until they all finish their work and then drop the ` IndexWriter ` .
mut self
mut self