MCPcopy Index your code
hub / github.com/google/gvisor / IDOfTask

Method IDOfTask

pkg/sentry/kernel/threads.go:318–323  ·  view source on GitHub ↗

IDOfTask returns the TID assigned to the given task in PID namespace ns. If the task is not visible in that namespace, IDOfTask returns 0. (This return value is significant in some cases, e.g. getppid() is documented as returning 0 if the caller's parent is in an ancestor namespace and consequently

(t *Task)

Source from the content-addressed store, hash-verified

316// consequently not visible to the caller.) If the task is nil, IDOfTask returns
317// 0.
318func (ns *PIDNamespace) IDOfTask(t *Task) ThreadID {
319 ns.owner.mu.RLock()
320 id := ns.tids[t]
321 ns.owner.mu.RUnlock()
322 return id
323}
324
325// IDOfThreadGroup returns the TID assigned to tg's leader in PID namespace ns.
326// If the task is not visible in that namespace, IDOfThreadGroup returns 0.

Callers 15

reportMethod · 0.80
getAsyncOwnerFunction · 0.80
translatePIDFunction · 0.80
KillFunction · 0.80
GenerateMethod · 0.80
GenerateMethod · 0.80
GenerateMethod · 0.80
GenerateMethod · 0.80
TestTasksFunction · 0.80
ReadlinkMethod · 0.80
deliverSignalMethod · 0.80
StartProcessMethod · 0.80

Calls 2

RLockMethod · 0.45
RUnlockMethod · 0.45

Tested by 1

TestTasksFunction · 0.64