github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/waiter/waiter_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package waiter 4 5 import ( 6 "context" 7 8 "github.com/metacubex/gvisor/pkg/state" 9 ) 10 11 func (e *Entry) StateTypeName() string { 12 return "pkg/waiter.Entry" 13 } 14 15 func (e *Entry) StateFields() []string { 16 return []string{ 17 "waiterEntry", 18 "eventListener", 19 "mask", 20 } 21 } 22 23 func (e *Entry) beforeSave() {} 24 25 // +checklocksignore 26 func (e *Entry) StateSave(stateSinkObject state.Sink) { 27 e.beforeSave() 28 stateSinkObject.Save(0, &e.waiterEntry) 29 stateSinkObject.Save(1, &e.eventListener) 30 stateSinkObject.Save(2, &e.mask) 31 } 32 33 func (e *Entry) afterLoad(context.Context) {} 34 35 // +checklocksignore 36 func (e *Entry) StateLoad(ctx context.Context, stateSourceObject state.Source) { 37 stateSourceObject.Load(0, &e.waiterEntry) 38 stateSourceObject.Load(1, &e.eventListener) 39 stateSourceObject.Load(2, &e.mask) 40 } 41 42 func (q *Queue) StateTypeName() string { 43 return "pkg/waiter.Queue" 44 } 45 46 func (q *Queue) StateFields() []string { 47 return []string{ 48 "list", 49 } 50 } 51 52 func (q *Queue) beforeSave() {} 53 54 // +checklocksignore 55 func (q *Queue) StateSave(stateSinkObject state.Sink) { 56 q.beforeSave() 57 stateSinkObject.Save(0, &q.list) 58 } 59 60 func (q *Queue) afterLoad(context.Context) {} 61 62 // +checklocksignore 63 func (q *Queue) StateLoad(ctx context.Context, stateSourceObject state.Source) { 64 stateSourceObject.Load(0, &q.list) 65 } 66 67 func (l *waiterList) StateTypeName() string { 68 return "pkg/waiter.waiterList" 69 } 70 71 func (l *waiterList) StateFields() []string { 72 return []string{ 73 "head", 74 "tail", 75 } 76 } 77 78 func (l *waiterList) beforeSave() {} 79 80 // +checklocksignore 81 func (l *waiterList) StateSave(stateSinkObject state.Sink) { 82 l.beforeSave() 83 stateSinkObject.Save(0, &l.head) 84 stateSinkObject.Save(1, &l.tail) 85 } 86 87 func (l *waiterList) afterLoad(context.Context) {} 88 89 // +checklocksignore 90 func (l *waiterList) StateLoad(ctx context.Context, stateSourceObject state.Source) { 91 stateSourceObject.Load(0, &l.head) 92 stateSourceObject.Load(1, &l.tail) 93 } 94 95 func (e *waiterEntry) StateTypeName() string { 96 return "pkg/waiter.waiterEntry" 97 } 98 99 func (e *waiterEntry) StateFields() []string { 100 return []string{ 101 "next", 102 "prev", 103 } 104 } 105 106 func (e *waiterEntry) beforeSave() {} 107 108 // +checklocksignore 109 func (e *waiterEntry) StateSave(stateSinkObject state.Sink) { 110 e.beforeSave() 111 stateSinkObject.Save(0, &e.next) 112 stateSinkObject.Save(1, &e.prev) 113 } 114 115 func (e *waiterEntry) afterLoad(context.Context) {} 116 117 // +checklocksignore 118 func (e *waiterEntry) StateLoad(ctx context.Context, stateSourceObject state.Source) { 119 stateSourceObject.Load(0, &e.next) 120 stateSourceObject.Load(1, &e.prev) 121 } 122 123 func init() { 124 state.Register((*Entry)(nil)) 125 state.Register((*Queue)(nil)) 126 state.Register((*waiterList)(nil)) 127 state.Register((*waiterEntry)(nil)) 128 }