(device=None)
| 395 | |
| 396 | |
| 397 | def 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 | |
| 417 | def start_render_thread(device): |
no test coverage detected