Author: jmesnil
Date: 2009-12-09 11:09:45 -0500 (Wed, 09 Dec 2009)
New Revision: 8641
Modified:
trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
Log:
reverted r8634
Modified: trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java 2009-12-09 14:39:46 UTC
(rev 8640)
+++ trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java 2009-12-09 16:09:45 UTC
(rev 8641)
@@ -115,7 +115,7 @@
callbacks = new ArrayList<IOAsyncTask>();
- this.timeout = timeout;
+ this.timeout = timeout;
}
public synchronized void start()
@@ -137,15 +137,6 @@
logRatesTimer.scheduleAtFixedRate(logRatesTimerTask, 2000, 2000);
}
-
- //Need to start with the spin limiter acquired
- try
- {
- spinLimiter.acquire();
- }
- catch (InterruptedException ignore)
- {
- }
started = true;
}
@@ -249,6 +240,13 @@
{
delayFlush = false;
+ if (buffer.writerIndex() == 0)
+ {
+ // More bytes have been added so the timer flush thread can resume
+
+ spinLimiter.release();
+ }
+
bytes.encode(buffer);
callbacks.add(callback);
@@ -265,13 +263,6 @@
//
// flush();
// }
-
- if (buffer.writerIndex() == 0)
- {
- // More bytes have been added so the timer flush thread can resume
-
- spinLimiter.release();
- }
}
}
Show replies by date