Improve Double Checked Locking Javadoc

This commit is contained in:
Ilkka Seppala 2015-10-03 21:00:21 +03:00
parent 8cf35fc315
commit e32b440a38

View File

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