File tree Expand file tree Collapse file tree
geowebcache/core/src/main/java/org/geowebcache/locks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717import java .util .concurrent .locks .ReentrantLock ;
1818import org .apache .commons .codec .digest .DigestUtils ;
19+ import org .apache .commons .logging .Log ;
20+ import org .apache .commons .logging .LogFactory ;
1921import org .geowebcache .GeoWebCacheException ;
2022
2123/**
2527 */
2628public class MemoryLockProvider implements LockProvider {
2729
30+ private static Log LOGGER = LogFactory .getLog (MemoryLockProvider .class );
31+
2832 java .util .concurrent .locks .Lock [] locks ;
2933
3034 public MemoryLockProvider () {
@@ -40,7 +44,12 @@ public MemoryLockProvider(int concurrency) {
4044
4145 public Lock getLock (String lockKey ) {
4246 final int idx = getIndex (lockKey );
47+ if (LOGGER .isDebugEnabled ())
48+ LOGGER .debug ("Mapped lock key " + lockKey + " to index " + idx + ". Acquiring lock." );
4349 locks [idx ].lock ();
50+ if (LOGGER .isDebugEnabled ())
51+ LOGGER .debug ("Mapped lock key " + lockKey + " to index " + idx + ". Lock acquired" );
52+
4453 return new Lock () {
4554
4655 boolean released = false ;
@@ -49,6 +58,8 @@ public void release() throws GeoWebCacheException {
4958 if (!released ) {
5059 released = true ;
5160 locks [idx ].unlock ();
61+ if (LOGGER .isDebugEnabled ())
62+ LOGGER .debug ("Released lock key " + lockKey + " mapped to index " + idx );
5263 }
5364 }
5465 };
Original file line number Diff line number Diff line change @@ -164,6 +164,8 @@ public void release() throws GeoWebCacheException {
164164 LOGGER .debug (
165165 "Lock "
166166 + lockKey
167+ + " on file "
168+ + lockFile
167169 + " released by thread "
168170 + Thread .currentThread ().getId ());
169171 }
You can’t perform that action at this time.
0 commit comments