Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 7447)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 7448)
@@ -1343,5 +1343,6 @@
         @Override
         public List<StyleRecord> call() throws Exception {
-            synchronized (MapCSSStyleSource.STYLE_SOURCE_LOCK) {
+            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
+            try {
                 for (int i = from; i<to; i++) {
                     OsmPrimitive osm = input.get(i);
@@ -1351,4 +1352,6 @@
                 }
                 return output;
+            } finally {
+                MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 7447)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 7448)
@@ -91,6 +91,9 @@
             if (!prim.isSelectable()) return false;
             // if it isn't displayed on screen, you cannot click on it
-            synchronized (MapCSSStyleSource.STYLE_SOURCE_LOCK) {
+            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
+            try {
                 return !MapPaintStyles.getStyles().get(prim, getDist100Pixel(), NavigatableComponent.this).isEmpty();
+            } finally {
+                MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 7447)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java	(revision 7448)
@@ -337,5 +337,6 @@
         double scale = nc.getDist100Pixel();
 
-        synchronized (MapCSSStyleSource.STYLE_SOURCE_LOCK) {
+        MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
+        try {
             for (OsmPrimitive osm : sel) {
                 txtMappaint.append(tr("Styles Cache for \"{0}\":", osm.getDisplayName(DefaultNameFormatter.getInstance())));
@@ -362,4 +363,6 @@
                 txtMappaint.append("\n\n");
             }
+        } finally {
+            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
         }
         if (sel.size() == 2) {
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 7447)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 7448)
@@ -447,5 +447,6 @@
      */
     public static AreaElemStyle getAreaElemStyle(OsmPrimitive p, boolean pretendWayIsClosed) {
-        synchronized (MapCSSStyleSource.STYLE_SOURCE_LOCK) {
+        MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
+        try {
             if (MapPaintStyles.getStyles() == null)
                 return null;
@@ -455,4 +456,6 @@
             }
             return null;
+        } finally {
+            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 7447)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 7448)
@@ -144,6 +144,9 @@
             virtualNode.put(tag.getKey(), tag.getValue());
             StyleList styleList;
-            synchronized (MapCSSStyleSource.STYLE_SOURCE_LOCK) {
+            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
+            try {
                 styleList = getStyles().generateStyles(virtualNode, 0.5, null, false).a;
+            } finally {
+                MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
             }
             if (styleList != null) {
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 7447)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 7448)
@@ -20,4 +20,6 @@
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
@@ -70,5 +72,5 @@
 
     /**
-     * This lock prevents concurrent execution of {@link MapCSSRuleIndex#clear() },
+     * This lock prevents concurrent execution of {@link MapCSSRuleIndex#clear() } /
      * {@link MapCSSRuleIndex#initIndex()} and {@link MapCSSRuleIndex#getRuleCandidates }.
      * 
@@ -76,6 +78,6 @@
      * stack trace.
      */
-    public final static Object STYLE_SOURCE_LOCK = new Object();
-    
+    public final static ReadWriteLock STYLE_SOURCE_LOCK = new ReentrantReadWriteLock();
+
     /**
      * A collection of {@link MapCSSRule}s, that are indexed by tag key and value.
@@ -100,6 +102,4 @@
         public final Set<MapCSSRule> remaining = new HashSet<>();
         
-        private static final boolean DEBUG_LOCKING = false;
-        
         public void add(MapCSSRule rule) {
             rules.add(rule);
@@ -109,12 +109,7 @@
          * Initialize the index.
          * 
-         * You must own the lock STYLE_SOURCE_LOCK when calling this method.
+         * You must own the write lock of STYLE_SOURCE_LOCK when calling this method.
          */
         public void initIndex() {
-            if (DEBUG_LOCKING) {
-                if (!Thread.holdsLock(STYLE_SOURCE_LOCK)) {
-                    throw new RuntimeException();
-                }
-            }
             for (MapCSSRule r: rules) {
                 // find the rightmost selector, this must be a GeneralSelector
@@ -154,12 +149,7 @@
          * that cannot match, based on the tags of the primitive
          * 
-         * You must own the lock STYLE_SOURCE_LOCK when calling this method.
+         * You must have a read lock of STYLE_SOURCE_LOCK when calling this method.
          */
         public Collection<MapCSSRule> getRuleCandidates(OsmPrimitive osm) {
-            if (DEBUG_LOCKING) {
-                if (!Thread.holdsLock(STYLE_SOURCE_LOCK)) {
-                    throw new RuntimeException();
-                }
-            }
             List<MapCSSRule> ruleCandidates = new ArrayList<>(remaining);
             for (Map.Entry<String,String> e : osm.getKeys().entrySet()) {
@@ -179,12 +169,7 @@
          * Clear the index.
          * 
-         * You must own the lock STYLE_SOURCE_LOCK when calling this method.
+         * You must own the write lock STYLE_SOURCE_LOCK when calling this method.
          */
         public void clear() {
-            if (DEBUG_LOCKING) {
-                if (!Thread.holdsLock(STYLE_SOURCE_LOCK)) {
-                    throw new RuntimeException();
-                }
-            }
             rules.clear();
             index.clear();
@@ -216,5 +201,6 @@
     @Override
     public void loadStyleSource() {
-        synchronized (STYLE_SOURCE_LOCK) {
+        STYLE_SOURCE_LOCK.writeLock().lock();
+        try {
             init();
             rules.clear();
@@ -304,4 +290,6 @@
             multipolygonRules.initIndex();
             canvasRules.initIndex();
+        } finally {
+            STYLE_SOURCE_LOCK.writeLock().unlock();
         }
     }
