summaryrefslogtreecommitdiffhomepage
path: root/pkg/state/encode.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2019-10-31 18:02:04 -0700
committergVisor bot <gvisor-bot@google.com>2019-10-31 18:03:24 -0700
commita99d3479a84ca86843e500dbdf58db0af389b536 (patch)
tree4bce14ea740020ee2652a6a874517550174d1f34 /pkg/state/encode.go
parent36837c4ad3f3c840791379db81d02b60d918c0f5 (diff)
Add context to state.
PiperOrigin-RevId: 277840416
Diffstat (limited to 'pkg/state/encode.go')
-rw-r--r--pkg/state/encode.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/state/encode.go b/pkg/state/encode.go
index 5d9409a45..c5118d3a9 100644
--- a/pkg/state/encode.go
+++ b/pkg/state/encode.go
@@ -16,6 +16,7 @@ package state
import (
"container/list"
+ "context"
"encoding/binary"
"fmt"
"io"
@@ -38,6 +39,9 @@ type queuedObject struct {
// The encoding process is a breadth-first traversal of the object graph. The
// inherent races and dependencies are much simpler than the decode case.
type encodeState struct {
+ // ctx is the encode context.
+ ctx context.Context
+
// lastID is the last object ID.
//
// See idsByObject for context. Because of the special zero encoding