(device)
| 439 | |
| 440 | |
| 441 | def 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 | |
| 466 | def update_render_threads(render_devices, active_devices): |
no test coverage detected