docs: align double-checked-locking README with actual Inventory implementation by 1wu-davy-2 · Pull Request #3623 · iluwatar/java-design-patterns · GitHub
Skip to content

docs: align double-checked-locking README with actual Inventory implementation - #3623

Open
1wu-davy-2 wants to merge 1 commit into
iluwatar:masterfrom
1wu-davy-2:docs/fix-double-checked-locking-readme
Open

1wu-davy-2 wants to merge 1 commit into
iluwatar:masterfrom
1wu-davy-2:docs/fix-double-checked-locking-readme

Conversation

@1wu-davy-2

Copy link
Copy Markdown

Description

README previously described non-existent HolderThreadSafe and Heavy classes; updated to match the real Inventory + ReentrantLock implementation.

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

  • Only documentation change (double-checked-locking/README.md)
  • Code snippets verified against Inventory.java
  • No remaining references to HolderThreadSafe or Heavy

Assisted by AI tools for initial analysis; all changes manually verified and tested.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant