def __init__(self, f, n, wait_before_exit=False):
        self.f = f
        self.n = n
        self.started = []
        self.finished = []
        self._can_exit = not wait_before_exit
        def task():
            tid = threading.get_ident()
            self.started.append(tid)
            try:
                f()
            finally:
                self.finished.append(tid)
                while not self._can_exit:
                    _wait()
        for i in range(n):
            start_new_thread(task, ())
Handle the RetractItem dock layout op.
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/lock_tests.py/Bunch.__init__--crossover with--dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/qt/docking/layout_builder.py/LayoutBuilder.visit_RetractItem