Author: xor
Date: 2008-11-04 12:42:37 +0000 (Tue, 04 Nov 2008)
New Revision: 23310

Modified:
   trunk/plugins/FMSPlugin/FMSBoard.java
Log:
I think we should maybe just lock the whole MessageManager here to prevent 
deletion of parent messages while we sort the new message in.

Modified: trunk/plugins/FMSPlugin/FMSBoard.java
===================================================================
--- trunk/plugins/FMSPlugin/FMSBoard.java       2008-11-04 12:39:57 UTC (rev 
23309)
+++ trunk/plugins/FMSPlugin/FMSBoard.java       2008-11-04 12:42:37 UTC (rev 
23310)
@@ -61,11 +61,11 @@
         * The job for this function is to find the right place in the 
thread-tree for the new message and to move around older messages
         * if a parent message of them is received.
         */
-       public synchronized void addMessage(FMSMessage newMessage) throws 
UpdatableSortedLinkedListKilledException {    
-               db.store(newMessage);
-               db.commit();
-               
-               synchronized(newMessage) {
+       public synchronized void addMessage(FMSMessage newMessage) throws 
UpdatableSortedLinkedListKilledException {
+               synchronized(mMessageManager) {
+                       db.store(newMessage);
+                       db.commit();
+
                        if(!newMessage.isThread())
                        {
                                FreenetURI parentURI = 
newMessage.getParentURI();


Reply via email to