MCPcopy
hub / github.com/rclone/rclone / PinUntilFinalized

Function PinUntilFinalized

fs/cache/cache.go:153–158  ·  view source on GitHub ↗

PinUntilFinalized pins f into the cache until x is garbage collected This calls runtime.SetFinalizer on x so it shouldn't have a finalizer already.

(f fs.Fs, x any)

Source from the content-addressed store, hash-verified

151// This calls runtime.SetFinalizer on x so it shouldn't have a
152// finalizer already.
153func PinUntilFinalized(f fs.Fs, x any) {
154 Pin(f)
155 runtime.SetFinalizer(x, func(_ any) {
156 Unpin(f)
157 })
158}
159
160// Unpin f from the cache
161func Unpin(f fs.Fs) {

Callers 8

NewFsFunction · 0.92
NewFunction · 0.92
NewFsFunction · 0.92
NewFsFunction · 0.92
NewFsFunction · 0.92
newUpstreamMethod · 0.92
NewFsFunction · 0.92
NewFunction · 0.92

Calls 3

PinFunction · 0.85
UnpinFunction · 0.85
SetFinalizerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…