diff options
Diffstat (limited to 'vendor/github.com/hashicorp/go-plugin/process.go')
-rw-r--r-- | vendor/github.com/hashicorp/go-plugin/process.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/go-plugin/process.go b/vendor/github.com/hashicorp/go-plugin/process.go new file mode 100644 index 0000000..88c999a --- /dev/null +++ b/vendor/github.com/hashicorp/go-plugin/process.go | |||
@@ -0,0 +1,24 @@ | |||
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 | } | ||