clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1532255 - /clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/IndexDefinitionManager.java
Date Tue, 15 Oct 2013 09:09:29 GMT
Author: reto
Date: Tue Oct 15 09:09:28 2013
New Revision: 1532255

URL: http://svn.apache.org/r1532255
Log:
CLEREZZA-831: added locking

Modified:
    clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/IndexDefinitionManager.java

Modified: clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/IndexDefinitionManager.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/IndexDefinitionManager.java?rev=1532255&r1=1532254&r2=1532255&view=diff
==============================================================================
--- clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/IndexDefinitionManager.java
(original)
+++ clerezza/trunk/rdf.cris/core/src/main/java/org/apache/clerezza/rdf/cris/IndexDefinitionManager.java
Tue Oct 15 09:09:28 2013
@@ -104,9 +104,14 @@ public class IndexDefinitionManager {
      */
     public void deleteDefinition(UriRef rdfType) {
         GraphNode node = new GraphNode(rdfType, definitionGraph);
-        Iterator<GraphNode> iter = node.getSubjectNodes(CRIS.indexedType);
-        while (iter.hasNext()) {
-            iter.next().deleteNodeContext();
+        node.writeLock().lock();
+        try {
+            Iterator<GraphNode> iter = node.getSubjectNodes(CRIS.indexedType);
+            while (iter.hasNext()) {
+                iter.next().deleteNodeContext();
+            }
+        } finally {
+            node.writeLock().unlock();
         }
     }
 



Mime
View raw message