updateSnapshotRef is like UpdateSnapshot but returns the created snapshot with an extra reference for the caller. The ref is taken atomically with the snapshot assignment under snapshotMu, so the snapshot is guaranteed to be alive when returned. The caller must call snapshot.Deref(s) when done.
(ctx context.Context, overlays map[tspath.Path]*Overlay, change SnapshotChange)
| 1196 | // the snapshot assignment under snapshotMu, so the snapshot is guaranteed |
| 1197 | // to be alive when returned. The caller must call snapshot.Deref(s) when done. |
| 1198 | func (s *Session) updateSnapshotRef(ctx context.Context, overlays map[tspath.Path]*Overlay, change SnapshotChange) *Snapshot { |
| 1199 | return s.updateSnapshot(ctx, overlays, change, true) |
| 1200 | } |
| 1201 | |
| 1202 | func (s *Session) updateSnapshot(ctx context.Context, overlays map[tspath.Path]*Overlay, change SnapshotChange, callerRef bool) *Snapshot { |
| 1203 | s.snapshotMu.Lock() |
no test coverage detected