MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / is_alive

Function is_alive

ui/easydiffusion/task_manager.py:397–414  ·  view source on GitHub ↗
(device=None)

Source from the content-addressed store, hash-verified

395
396
397def is_alive(device=None):
398 if not manager_lock.acquire(blocking=True, timeout=LOCK_TIMEOUT):
399 raise Exception("is_alive" + ERR_LOCK_FAILED)
400 nbr_alive = 0
401 try:
402 for rthread in render_threads:
403 if device is not None:
404 weak_data = weak_thread_data.get(rthread)
405 if weak_data is None or not "device" in weak_data or weak_data["device"] is None:
406 continue
407 thread_device = weak_data["device"]
408 if thread_device != device:
409 continue
410 if rthread.is_alive():
411 nbr_alive += 1
412 return nbr_alive
413 finally:
414 manager_lock.release()
415
416
417def start_render_thread(device):

Callers 3

thread_get_next_taskFunction · 0.85
update_render_threadsFunction · 0.85
enqueue_taskFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected