Author: trustin
Date: Sat Mar 22 01:36:21 2008
New Revision: 639962
URL: http://svn.apache.org/viewvc?rev=639962&view=rev
Log:
Disabled the optimization in flush operation due to StackOverflowError
Modified:
mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingIoProcessor.java
Modified:
mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingIoProcessor.java
URL:
http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingIoProcessor.java?rev=639962&r1=639961&r2=639962&view=diff
==============================================================================
---
mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingIoProcessor.java
(original)
+++
mina/trunk/core/src/main/java/org/apache/mina/common/AbstractPollingIoProcessor.java
Sat Mar 22 01:36:21 2008
@@ -201,15 +201,17 @@
}
public final void flush(T session) {
- if (Thread.currentThread() == workerThread) {
- // Bypass the queue if called from the worker thread itself
- // (i.e. single thread model).
- flushNow(session, System.currentTimeMillis());
- } else {
- boolean needsWakeup = flushingSessions.isEmpty();
- if (scheduleFlush(session) && needsWakeup) {
- wakeup();
- }
+ // The following optimization has been disabled because it can cause
StackOverflowError.
+ //if (Thread.currentThread() == workerThread) {
+ // // Bypass the queue if called from the worker thread itself
+ // // (i.e. single thread model).
+ // flushNow(session, System.currentTimeMillis());
+ // return;
+ //}
+
+ boolean needsWakeup = flushingSessions.isEmpty();
+ if (scheduleFlush(session) && needsWakeup) {
+ wakeup();
}
}