summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/task_run.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-11-13 18:09:15 -0800
committergVisor bot <gvisor-bot@google.com>2020-11-13 18:10:55 -0800
commit182c126013a28f19594ff61326f1f9a2c481f1b4 (patch)
tree154781219cefea14a41d32e2465cebb6bfc0fd51 /pkg/sentry/kernel/task_run.go
parent0fee59c8c84bff0185e681b4550ba077a65739f2 (diff)
Log task goroutine IDs in the sentry watchdog.
PiperOrigin-RevId: 342373580
Diffstat (limited to 'pkg/sentry/kernel/task_run.go')
-rw-r--r--pkg/sentry/kernel/task_run.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/task_run.go b/pkg/sentry/kernel/task_run.go
index c5858da30..3ccecf4b6 100644
--- a/pkg/sentry/kernel/task_run.go
+++ b/pkg/sentry/kernel/task_run.go
@@ -390,6 +390,11 @@ func (t *Task) assertTaskGoroutine() {
}
}
+// GoroutineID returns the ID of t's task goroutine.
+func (t *Task) GoroutineID() int64 {
+ return atomic.LoadInt64(&t.goid)
+}
+
// waitGoroutineStoppedOrExited blocks until t's task goroutine stops or exits.
func (t *Task) waitGoroutineStoppedOrExited() {
t.goroutineStopped.Wait()