def _get_current(): if not utils.in_cpubound_thread() and constants.server_started: return gevent.getcurrent() else: return threading.local()