Skip to content

Commit

Permalink
Fix a comment documenting the locking rules
Browse files Browse the repository at this point in the history
We only care about concurrency within the scope of
HasThreadSafePutBlob.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Feb 8, 2024
1 parent 31f6eeb commit 2029a3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/storage_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ type storageImageDestination struct {
// `queueOrCommit()` for further details on how the single-caller
// guarantee is implemented.
indexToStorageID map[int]string
// All accesses to below data are protected by `lock` which is made
// All accesses to below data are, during the concurrent TryReusingBlob/PutBlob/* calls
// (but not necessarily during the final Commit) protected by `lock` which is made
// *explicit* in the code.
uncompressedOrTocDigest map[digest.Digest]digest.Digest // Mapping from layer blobsums to their corresponding DiffIDs or TOC IDs.
fileSizes map[digest.Digest]int64 // Mapping from layer blobsums to their sizes
Expand Down

0 comments on commit 2029a3b

Please sign in to comment.