MCPcopy Create free account
hub / github.com/containers/image / Terminate

Method Terminate

internal/uploadreader/upload_reader.go:56–61  ·  view source on GitHub ↗

Terminate waits for in-progress Read calls, if any, to finish, and ensures that after this function returns, any Read calls will fail with the provided error, and the underlying reader will never be used any more. It is safe to call this from a different goroutine than Read.

(err error)

Source from the content-addressed store, hash-verified

54//
55// It is safe to call this from a different goroutine than Read.
56func (ur *UploadReader) Terminate(err error) {
57 ur.mutex.Lock() // May block for some time if ur.reader.Read() is in progress
58 defer ur.mutex.Unlock()
59
60 ur.terminationError = err
61}

Callers 2

TestUploadReaderFunction · 0.95
PutBlobWithOptionsMethod · 0.95

Calls

no outgoing calls

Tested by 1

TestUploadReaderFunction · 0.76