[jboss-cvs] JBossAS SVN: r110243 - branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/mail/inflow.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 3 09:54:29 EST 2011


Author: jesper.pedersen
Date: 2011-01-03 09:54:29 -0500 (Mon, 03 Jan 2011)
New Revision: 110243

Modified:
   branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/mail/inflow/NewMsgsWorker.java
Log:
[JBPAPP-5374] Mail MDB stop working due to negative Thread.sleep(timeout) call in NewMsgsWorker#run()

Modified: branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/mail/inflow/NewMsgsWorker.java
===================================================================
--- branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/mail/inflow/NewMsgsWorker.java	2011-01-03 12:59:21 UTC (rev 110242)
+++ branches/JBPAPP_5_1/connector/src/main/org/jboss/resource/adapter/mail/inflow/NewMsgsWorker.java	2011-01-03 14:54:29 UTC (rev 110243)
@@ -78,7 +78,8 @@
             long now = System.currentTimeMillis();
             long nextTime = ma.getNextNewMsgCheckTime();
             long sleepMS = nextTime - now;
-            Thread.sleep(sleepMS);
+            if (sleepMS > 0)
+               Thread.sleep(sleepMS);
             if( released )
                break;
             // This has to go after the sleep otherwise we can get into an inconsistent state



More information about the jboss-cvs-commits mailing list