Code example for ReentrantLock

import java.util.concurrent.locks.ReentrantLock; 
public class MapsforgeCacheOverlay extends ItemizedOverlay<MapsforgeCacheOverlayItem> implements ItemizedOverlayImpl { 
    private CachesOverlay base;
    private Lock lock = new ReentrantLock();
    public MapsforgeCacheOverlay(Context contextIn, Drawable markerIn) {
        base = new CachesOverlay(this, contextIn);
    public CachesOverlay getBase() { 
        return base;
    protected MapsforgeCacheOverlayItem createItem(int i) {
        if (base == null) {
Connect your IDE to all the code out there  Get Codota for Java