Code example for ReentrantLock

 * 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) {
        base = new CachesOverlay(this, contextIn);
    public CachesOverlay getBase() { 
        return base;
    protected GoogleCacheOverlayItem createItem(int i) {
        if (base == null) {
Connect your IDE to all the code out there  Get Codota for Java