1package plugin 2 3import ( 4 "time" 5) 6 7// pidAlive checks whether a pid is alive. 8func pidAlive(pid int) bool { 9 return _pidAlive(pid) 10} 11 12// pidWait blocks for a process to exit. 13func pidWait(pid int) error { 14 ticker := time.NewTicker(1 * time.Second) 15 defer ticker.Stop() 16 17 for range ticker.C { 18 if !pidAlive(pid) { 19 break 20 } 21 } 22 23 return nil 24} 25