Author: j16sdiz
Date: 2009-01-01 11:19:44 +0000 (Thu, 01 Jan 2009)
New Revision: 24857

Modified:
   trunk/plugins/XMLSpider/db/Page.java
Log:
locking on page status change

Modified: trunk/plugins/XMLSpider/db/Page.java
===================================================================
--- trunk/plugins/XMLSpider/db/Page.java        2009-01-01 11:19:34 UTC (rev 
24856)
+++ trunk/plugins/XMLSpider/db/Page.java        2009-01-01 11:19:44 UTC (rev 
24857)
@@ -121,7 +121,12 @@
                if (storage != null) {
                        PerstRoot root = (PerstRoot) storage.getRoot();
                        FieldIndex<Page> coll = root.getPageIndex(status);
-                       coll.remove(this);
+                       coll.exclusiveLock();
+                       try {
+                               coll.remove(this);
+                       } finally {
+                               coll.unlock();
+                       }
                }
        }
 
@@ -135,7 +140,12 @@
                if (storage != null) {
                        PerstRoot root = (PerstRoot) storage.getRoot();
                        FieldIndex<Page> coll = root.getPageIndex(status);
-                       coll.put(this);
+                       coll.exclusiveLock();
+                       try {
+                               coll.put(this);
+                       } finally {
+                               coll.unlock();
+                       }
                }
        }
 }

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to