Function
_try_acquire_pidlock
(lock_file, out_file, lock_pid=None)
Source from the content-addressed store, hash-verified
| 110 | |
| 111 | |
| 112 | def _try_acquire_pidlock(lock_file, out_file, lock_pid=None): |
| 113 | lock = library.python.filelock.PidFileLock(lock_file) |
| 114 | with open(out_file, "w") as afile: |
| 115 | afile.write("1" if lock.acquire(blocking=False) else "0") |
| 116 | |
| 117 | if lock_pid is not None: |
| 118 | assert lock.info.pid == lock_pid |
| 119 | |
| 120 | |
| 121 | def test_pidfilelock_multiprocessing(): |
Callers
nothing calls this directly
Tested by
no test coverage detected