(instanceID string)
| 16 | var dataPoolLock = new(sync.RWMutex) |
| 17 | |
| 18 | func WatchInstancePid(instanceID string) int { |
| 19 | for { |
| 20 | dataPoolLock.RLock() |
| 21 | pid, ok := containerInstancePidMap[instanceID] |
| 22 | dataPoolLock.RUnlock() |
| 23 | if ok { |
| 24 | return pid |
| 25 | } |
| 26 | time.Sleep(checkGap) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func TryGetInstancePid(instanceID string) (int, bool) { |
| 31 | dataPoolLock.RLock() |
nothing calls this directly
no outgoing calls
no test coverage detected