Skip to content

Commit e32b440

Browse files
committed
Improve Double Checked Locking Javadoc
1 parent 8cf35fc commit e32b440

File tree

1 file changed

+5
-0
lines changed
  • double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking

1 file changed

+5
-0
lines changed

double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/App.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
/**
77
*
8+
* Double Checked Locking is a concurrency design pattern used to reduce the overhead
9+
* of acquiring a lock by first testing the locking criterion (the "lock hint") without
10+
* actually acquiring the lock. Only if the locking criterion check indicates that
11+
* locking is required does the actual locking logic proceed.
12+
* <p>
813
* In {@link Inventory} we store the items with a given size. However, we do not store
914
* more items than the inventory size. To address concurrent access problems we
1015
* use double checked locking to add item to inventory. In this method, the

0 commit comments

Comments
 (0)