Code example for ReentrantLock

0
 * Google specific implementation of the itemized cache overlay 
 */ 
public class GoogleCacheOverlay extends ItemizedOverlay<GoogleCacheOverlayItem> implements ItemizedOverlayImpl { 
 
    private CachesOverlay base;
    private Lock lock = new ReentrantLock();
 
    public GoogleCacheOverlay(Context contextIn, Drawable markerIn) {
        super(boundCenterBottom(markerIn));
        base = new CachesOverlay(this, contextIn);
    } 
 
    @Override 
    public CachesOverlay getBase() { 
        return base;
    } 
 
    @Override 
    protected GoogleCacheOverlayItem createItem(int i) {
        if (base == null) {
            return null;