Plumb restore context to load*() methods.

This allows for external information to be passed to restore code.
Similar to c087777e37 ("Plumb restore context to afterLoad()").

Updates #1956.

PiperOrigin-RevId: 614125262
This commit is contained in:
Ayush Ranjan
2024-03-08 20:28:02 -08:00
committed by gVisor bot
parent a5c1062c75
commit 7e395bbbd4
37 changed files with 81 additions and 42 deletions
+2 -1
View File
@@ -15,6 +15,7 @@
package netstack
import (
"context"
"time"
)
@@ -24,7 +25,7 @@ func (s *sock) saveTimestamp() int64 {
return s.timestamp.UnixNano()
}
func (s *sock) loadTimestamp(nsec int64) {
func (s *sock) loadTimestamp(_ context.Context, nsec int64) {
s.readMu.Lock()
defer s.readMu.Unlock()
s.timestamp = time.Unix(0, nsec)