MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / stop_render_thread

Function stop_render_thread

ui/easydiffusion/task_manager.py:441–463  ·  view source on GitHub ↗
(device)

Source from the content-addressed store, hash-verified

439
440
441def stop_render_thread(device):
442 if not manager_lock.acquire(blocking=True, timeout=LOCK_TIMEOUT):
443 raise Exception("stop_render_thread" + ERR_LOCK_FAILED)
444 log.info(f"Stopping Rendering Thread on device: {device}")
445
446 try:
447 thread_to_remove = None
448 for rthread in render_threads:
449 weak_data = weak_thread_data.get(rthread)
450 if weak_data is None or not "device" in weak_data or weak_data["device"] is None:
451 continue
452 thread_device = weak_data["device"]
453 if thread_device == device:
454 weak_data["alive"] = False
455 thread_to_remove = rthread
456 break
457 if thread_to_remove is not None:
458 render_threads.remove(rthread)
459 return True
460 finally:
461 manager_lock.release()
462
463 return False
464
465
466def update_render_threads(render_devices, active_devices):

Callers 1

update_render_threadsFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected