You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by oy...@apache.org on 2008/02/15 16:03:08 UTC

svn commit: r628078 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java

Author: oysteing
Date: Fri Feb 15 07:03:07 2008
New Revision: 628078

URL: http://svn.apache.org/viewvc?rev=628078&view=rev
Log:
DERBY-3406: Fix unsynchronized calls to notify
Contributed by V Narayanan

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java?rev=628078&r1=628077&r2=628078&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java Fri Feb 15 07:03:07 2008
@@ -313,11 +313,11 @@
         
         fi = logBuffer.getFillInformation();
         
-        if (fi >= FI_HIGH) {
-            notify();
-        } else if ((System.currentTimeMillis() - lastShippingTime) > MIN) {
-            // Minimum MIN time between messages unless buffer is almost full
-            notify();
+        if (fi >= FI_HIGH || 
+                (System.currentTimeMillis() - lastShippingTime) > MIN) {
+            synchronized (this) {
+                notify();
+            }
         }
     }