MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isProcessRunning

Function isProcessRunning

src/utils/computerUse/computerUseLock.ts:65–72  ·  view source on GitHub ↗

* Check whether a process is still running (signal 0 probe). * * Note: there is a small window for PID reuse — if the owning process * exits and an unrelated process is assigned the same PID, the check * will return true. This is extremely unlikely in practice.

(pid: number)

Source from the content-addressed store, hash-verified

63 * will return true. This is extremely unlikely in practice.
64 */
65function isProcessRunning(pid: number): boolean {
66 try {
67 process.kill(pid, 0)
68 return true
69 } catch {
70 return false
71 }
72}
73
74/**
75 * Attempt to create the lock file atomically with O_EXCL.

Callers 2

checkComputerUseLockFunction · 0.70

Calls 1

killMethod · 0.45

Tested by

no test coverage detected