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

Function start_render_thread

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

Source from the content-addressed store, hash-verified

415
416
417def start_render_thread(device):
418 if not manager_lock.acquire(blocking=True, timeout=LOCK_TIMEOUT):
419 raise Exception("start_render_thread" + ERR_LOCK_FAILED)
420 log.info(f"Start new Rendering Thread on device: {device}")
421 try:
422 rthread = threading.Thread(target=thread_render, kwargs={"device": device})
423 rthread.daemon = True
424 rthread.name = THREAD_NAME_PREFIX + device
425 rthread.start()
426 render_threads.append(rthread)
427 finally:
428 manager_lock.release()
429 timeout = DEVICE_START_TIMEOUT
430 while not rthread.is_alive() or not rthread in weak_thread_data or not "device" in weak_thread_data[rthread]:
431 if rthread in weak_thread_data and "error" in weak_thread_data[rthread]:
432 log.error(f"{rthread}, {device}, error: {weak_thread_data[rthread]['error']}")
433 return False
434 if timeout <= 0:
435 return False
436 timeout -= 1
437 time.sleep(1)
438 return True
439
440
441def stop_render_thread(device):

Callers 1

update_render_threadsFunction · 0.85

Calls 2

appendMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected