def close(self):
    if (not self._disposed):
        self._disposed = True
        with self._dict_lock:
            for watcher_thread in self._run_id_to_watcher_dict.values():
                if (not watcher_thread.should_thread_exit.is_set()):
                    watcher_thread.should_thread_exit.set()
            for run_id in self._run_id_to_watcher_dict:
                self._run_id_to_watcher_dict[run_id].join()
            del self._run_id_to_watcher_dict
def close(self):
    if (not self._disposed):
        self._disposed = True
        with self._dict_lock:
            for watcher_thread in self._run_id_to_watcher_dict.values():
                if (not watcher_thread.should_thread_exit.is_set()):
                    watcher_thread.should_thread_exit.set()
            for run_id in self._run_id_to_watcher_dict:
                self._run_id_to_watcher_dict[run_id].join()
            del self._run_id_to_watcher_dict