]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/hashicorp/go-plugin/process.go
Initial transfer of provider code
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / go-plugin / process.go
1 package plugin
2
3 import (
4 "time"
5 )
6
7 // pidAlive checks whether a pid is alive.
8 func pidAlive(pid int) bool {
9 return _pidAlive(pid)
10 }
11
12 // pidWait blocks for a process to exit.
13 func 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 }