MCPcopy Create free account
hub / github.com/OpenSN-Library/OpenSN-Library / WatchInstancePid

Function WatchInstancePid

daemon/data/instance_pid.go:18–28  ·  view source on GitHub ↗
(instanceID string)

Source from the content-addressed store, hash-verified

16var dataPoolLock = new(sync.RWMutex)
17
18func 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
30func TryGetInstancePid(instanceID string) (int, bool) {
31 dataPoolLock.RLock()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected