MCPcopy Create free account
hub / github.com/catboost/catboost / _try_acquire_pidlock

Function _try_acquire_pidlock

library/python/filelock/ut/test_filelock.py:112–118  ·  view source on GitHub ↗
(lock_file, out_file, lock_pid=None)

Source from the content-addressed store, hash-verified

110
111
112def _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
121def test_pidfilelock_multiprocessing():

Callers

nothing calls this directly

Calls 3

openFunction · 0.50
writeMethod · 0.45
acquireMethod · 0.45

Tested by

no test coverage detected