MCPcopy Create free account
hub / github.com/FastLED/FastLED / is_lock_stale

Method is_lock_stale

ci/util/lock_database.py:257–275  ·  view source on GitHub ↗

Check if ALL holders have dead PIDs. Args: lock_name: Name identifying the lock Returns: True if lock is stale (all holders dead), False otherwise

(self, lock_name: str)

Source from the content-addressed store, hash-verified

255 conn.close()
256
257 def is_lock_stale(self, lock_name: str) -> bool:
258 """Check if ALL holders have dead PIDs.
259
260 Args:
261 lock_name: Name identifying the lock
262
263 Returns:
264 True if lock is stale (all holders dead), False otherwise
265 """
266 holders = self.get_lock_info(lock_name)
267 if not holders:
268 return False
269
270 for holder in holders:
271 pid = holder["owner_pid"]
272 if is_process_alive(pid):
273 return False
274
275 return True
276
277 def break_stale_lock(self, lock_name: str) -> bool:
278 """Remove rows where owner PID is dead.

Callers 6

_check_stale_lockMethod · 0.80
_check_stale_lockMethod · 0.80
is_artifact_lockedFunction · 0.80
is_lock_staleFunction · 0.80
__enter__Method · 0.80

Calls 2

get_lock_infoMethod · 0.95
is_process_aliveFunction · 0.90

Tested by 1