[jboss-cvs] JBoss Messaging SVN: r7170 - trunk/src/main/org/jboss/messaging/core/asyncio/impl.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jun 2 23:40:09 EDT 2009
Author: clebert.suconic at jboss.com
Date: 2009-06-02 23:40:09 -0400 (Tue, 02 Jun 2009)
New Revision: 7170
Modified:
trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java
Log:
small tweak
Modified: trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java 2009-06-03 03:30:51 UTC (rev 7169)
+++ trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java 2009-06-03 03:40:09 UTC (rev 7170)
@@ -102,15 +102,6 @@
lock.unlock();
}
- /** used to determine that a sync happened, and we should schedule flush to not take more than timeout no matter the activity on the buffer */
- public synchronized void sync()
- {
- if (timeLastSync == 0)
- {
- timeLastSync = System.currentTimeMillis();
- }
- }
-
/**
* Verify if the size fits the buffer
* @param sizeChecked
@@ -151,9 +142,15 @@
public synchronized void addBytes(final ByteBuffer bytes, final boolean sync, final AIOCallback callback)
{
timeLastAdd = System.currentTimeMillis();
+
+
if (sync)
{
- this.timeLastSync = timeLastAdd;
+ // We should flush on the next timeout, no matter what other activity happens on the buffer
+ if (timeLastSync == 0)
+ {
+ timeLastSync = System.currentTimeMillis();
+ }
}
currentBuffer.put(bytes);
More information about the jboss-cvs-commits
mailing list