()
| 51 | |
| 52 | |
| 53 | def release_cache_lock(): |
| 54 | global acquired_count |
| 55 | acquired_count -= 1 |
| 56 | assert acquired_count >= 0, "Called release more times than acquire" |
| 57 | if acquired_count == 0: |
| 58 | assert os.environ['EM_CACHE_IS_LOCKED'] == '1' |
| 59 | del os.environ['EM_CACHE_IS_LOCKED'] |
| 60 | cachelock.release() |
| 61 | logger.debug(f'PID {os.getpid()} released multiprocess file lock to Emscripten cache at {cachedir}') |
| 62 | |
| 63 | |
| 64 | @contextlib.contextmanager |