From e32b440a38e74520de5813e277c105e8e14074d2 Mon Sep 17 00:00:00 2001 From: Ilkka Seppala Date: Sat, 3 Oct 2015 21:00:21 +0300 Subject: [PATCH] Improve Double Checked Locking Javadoc --- .../main/java/com/iluwatar/doublechecked/locking/App.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/App.java b/double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/App.java index 2a5c65813..80806e9eb 100644 --- a/double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/App.java +++ b/double-checked-locking/src/main/java/com/iluwatar/doublechecked/locking/App.java @@ -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. + *

* 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