def run_in_thread(self, func, *args, **kwargs):
        """
        Runs ``func(*args, **kwargs)`` in a thread. Blocks the current greenlet
        until results are available.

        Exceptions thrown will be reraised in the calling thread.

        If the threadpool was initialized with nthreads=0, it invokes
        ``func(*args, **kwargs)`` directly, followed by eventlet.sleep() to
        ensure the eventlet hub has a chance to execute. It is more likely the
        hub will be invoked when queuing operations to an external thread.

        :returns: result of calling func
        :raises: whatever func raises
        """
        if not self._alive:
            raise swift.common.exceptions.ThreadPoolDead()

        if 0 <= self.nthreads:
            result = func(*args, **kwargs)
            sleep()
            return result

        ev = event.Event()
        self._run_queue.put((ev, func, args, kwargs), block=False)

        # blocks this greenlet (and only *this* greenlet) until the real
        # thread calls ev.send().
        result = ev.wait()
        return result
dataset/ETHPy150Open openstack/swift/swift/common/utils.py/ThreadPool.run_in_thread/swapped operands of `<=`