summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2018-08-07 13:08:37 -0700
committerShentubot <shentubot@google.com>2018-08-07 13:09:42 -0700
commitc036da5dffdf6cad912abe2723e69c04b59430b7 (patch)
treef5e25e02d4406d3795485e832bff1b65d1b9ee35 /pkg/sentry
parent7d3684aadf71255d3d8442ae1ed0b0f0048f95a3 (diff)
Hold TaskSet.mu in Task.Parent.
PiperOrigin-RevId: 207766238 Change-Id: Id3b66d8fe1f44c3570f67fa5ae7ba16021e35be1
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/kernel/threads.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/threads.go b/pkg/sentry/kernel/threads.go
index 844213c35..3d5713106 100644
--- a/pkg/sentry/kernel/threads.go
+++ b/pkg/sentry/kernel/threads.go
@@ -441,6 +441,8 @@ func (t *Task) Timekeeper() *Timekeeper {
// Parent returns t's parent.
func (t *Task) Parent() *Task {
+ t.tg.pidns.owner.mu.RLock()
+ defer t.tg.pidns.owner.mu.RUnlock()
return t.parent
}