github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sleep/sleep_unsafe_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package sleep 4 5 import ( 6 "github.com/MerlinKodo/gvisor/pkg/state" 7 ) 8 9 func (s *Sleeper) StateTypeName() string { 10 return "pkg/sleep.Sleeper" 11 } 12 13 func (s *Sleeper) StateFields() []string { 14 return []string{ 15 "sharedList", 16 "localList", 17 "allWakers", 18 } 19 } 20 21 func (s *Sleeper) beforeSave() {} 22 23 // +checklocksignore 24 func (s *Sleeper) StateSave(stateSinkObject state.Sink) { 25 s.beforeSave() 26 var sharedListValue *Waker 27 sharedListValue = s.saveSharedList() 28 stateSinkObject.SaveValue(0, sharedListValue) 29 stateSinkObject.Save(1, &s.localList) 30 stateSinkObject.Save(2, &s.allWakers) 31 } 32 33 func (s *Sleeper) afterLoad() {} 34 35 // +checklocksignore 36 func (s *Sleeper) StateLoad(stateSourceObject state.Source) { 37 stateSourceObject.Load(1, &s.localList) 38 stateSourceObject.Load(2, &s.allWakers) 39 stateSourceObject.LoadValue(0, new(*Waker), func(y any) { s.loadSharedList(y.(*Waker)) }) 40 } 41 42 func (w *Waker) StateTypeName() string { 43 return "pkg/sleep.Waker" 44 } 45 46 func (w *Waker) StateFields() []string { 47 return []string{ 48 "s", 49 "next", 50 "allWakersNext", 51 } 52 } 53 54 func (w *Waker) beforeSave() {} 55 56 // +checklocksignore 57 func (w *Waker) StateSave(stateSinkObject state.Sink) { 58 w.beforeSave() 59 var sValue wakerState 60 sValue = w.saveS() 61 stateSinkObject.SaveValue(0, sValue) 62 stateSinkObject.Save(1, &w.next) 63 stateSinkObject.Save(2, &w.allWakersNext) 64 } 65 66 func (w *Waker) afterLoad() {} 67 68 // +checklocksignore 69 func (w *Waker) StateLoad(stateSourceObject state.Source) { 70 stateSourceObject.Load(1, &w.next) 71 stateSourceObject.Load(2, &w.allWakersNext) 72 stateSourceObject.LoadValue(0, new(wakerState), func(y any) { w.loadS(y.(wakerState)) }) 73 } 74 75 func init() { 76 state.Register((*Sleeper)(nil)) 77 state.Register((*Waker)(nil)) 78 }