def run(): thread = threading.current_thread() try: log.debug("START thread %s (func=%s, args=%s, kwargs=%s)", thread, func, args, kwargs) pthread.setname(thread.name[:15]) ret = func(*args, **kwargs) log.debug("FINISH thread %s", thread) return ret except Exception: log.exception("FINISH thread %s failed", thread)
def run(): thread = threading.current_thread() try: log.debug("START thread %s (func=%s, args=%s, kwargs=%s)", thread, func, args, kwargs) pthread.setname(thread.name[:15]) ret = func(*args, **kwargs) log.debug("FINISH thread %s", thread) return ret except (SystemExit, KeyboardInterrupt) as e: # Unlikley, but not interesting. log.debug("FINISH thread %s (%s)", thread, e) except: log.exception("FINISH thread %s failed", thread)
def run(): pthread.setname(HELPER_NAME) ready.set() done.wait()
def run(): pthread.setname(NAME) names[0] = pthread.getname()