* Check if a process with the given PID is still running. * Uses signal 0 which tests existence without actually sending a signal.
(pid: number)
| 118 | * Uses signal 0 which tests existence without actually sending a signal. |
| 119 | */ |
| 120 | private isProcessAlive(pid: number): boolean { |
| 121 | try { |
| 122 | process.kill(pid, 0); |
| 123 | return true; |
| 124 | } catch { |
| 125 | return false; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Get the path to the lockfile (for testing/debugging). |