Author: timfox
Date: 2009-10-01 05:12:08 -0400 (Thu, 01 Oct 2009)
New Revision: 8023
Modified:
trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
Log:
fixed hanging test, slight improvement to fix
Modified: trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2009-10-01 09:09:08 UTC
(rev 8022)
+++ trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2009-10-01 09:12:08 UTC
(rev 8023)
@@ -346,8 +346,10 @@
if (sendSemaphore != null)
{
- //Any threads blocking on the send semaphore should be allowed to return
- sendSemaphore.release(Integer.MAX_VALUE - sendSemaphore.availablePermits());
+ //Any threads blocking on the send semaphore should be allowed to return - we do
this by just giving it
+ //a lot of permits - note we don't give it Integer.MAX_VALUE since then if
if more releases come in that
+ //could end up with permit count going -ve which would cause subsequent sends to
block
+ sendSemaphore.release(Integer.MAX_VALUE / 2);
}
if (!connection.isDestroyed() && !connection.removeChannel(id))
Show replies by date