Repository navigation
docs: align double-checked-locking README with actual Inventory implementation - #3623
1wu-davy-2 wants to merge 1 commit into
Conversation
PR SummaryAligned the double-checked locking README with the actual Inventory implementation. Replaced references to non-existent HolderThreadSafe/Heavy with the Inventory class and its ReentrantLock-based addItem logic. The Programmatic Example now documents the real double-checked locking flow: first a capacity check, then acquiring the lock, then a second capacity check inside the locked section, and adding an item. Updated class name and fields accordingly. Changes
autogenerated by presubmit.ai |
There was a problem hiding this comment.
✅ LGTM!
Review Summary
Commits Considered (1)
- b2aaa4a: docs: align double-checked-locking README with actual Inventory implementation
Files Processed (1)
- double-checked-locking/README.md (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
-
double-checked-locking/README.md [43-45]
readability: "Clarify terminology for the two-phase check"
-
double-checked-locking/README.md [57-59]
maintainability: "Unprotected first check may lead to data races"
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3623 +/- ##
============================================
- Coverage 84.06% 83.99% -0.08%
+ Complexity 4353 4347 -6
============================================
Files 1133 1133
Lines 15400 15400
Branches 739 739
============================================
- Hits 12946 12935 -11
- Misses 2158 2164 +6
- Partials 296 301 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
README previously described non-existent
HolderThreadSafeandHeavyclasses; updated to match the realInventory+ReentrantLockimplementation.The "Programmatic Example" section now documents the actual double-checked locking logic in
Inventory.addItem(), where the inventory size is checked once before acquiring the lock and once again inside the locked section.Checklist
double-checked-locking/README.md)Inventory.javaHolderThreadSafeorHeavyAssisted by AI tools for initial analysis; all changes manually verified and tested.