'run in separate thread; worker'

def search_files(self, all_folders, fn, sym, line, col, text):

    fn = fn.replace('/', os.sep)
    if os.path.isfile(fn):
        self._current_res.append((fn, line, col, 'f'))
    elif os.path.isdir(fn):
        self._current_res.append((fn, 0, 0, 'd'))
    seen_folders = []
    for folder in sorted(set(all_folders)):
        for (root, subdirs, _) in os.walk(folder):
            if self.stop_thread:
                return
            if (root in seen_folders):
                continue
            else:
                seen_folders.append(root)
            subdirs = [f for f in subdirs if (os.path.join(root, f) not in seen_folders)]
            tname = ('%s    at    %s' % (fn, root))
            self.thread.name = (tname if ST3 else tname.encode('utf8'))
            name = os.path.normpath(os.path.abspath(os.path.join(root, fn)))
            if os.path.isfile(name):
                item = (name, line, col, 'f')
                if (item not in self._current_res):
                    self._current_res.append(item)
            if os.path.isdir(name):
                item = (name, 0, 0, 'd')
                if (item not in self._current_res):
                    self._current_res.append(item)
    self._current_res = self._current_res[1:]
    if (not self._current_res):
        return sublime.error_message(('File    was    not    found\n\n DCTB %s' % fn))
    if (len(self._current_res) == 1):
        sublime.set_timeout((lambda : self._on_panel_selection(0)), 1)
    else:
        entries = [self._format_res(res) for res in self._current_res]
        sublime.set_timeout((lambda : self.window.show_quick_panel(entries, (lambda i: self._on_panel_selection(i, text=text, line=line)))), 1)
