[jboss-jira] [JBoss JIRA] Created: (JBMESSAGING-1811) Thread.sleep() is called with lock held in class NettyAcceptor

Wendy Feng (JIRA) jira-events at lists.jboss.org
Wed Jun 30 01:42:46 EDT 2010


Thread.sleep() is called with lock held in class NettyAcceptor
--------------------------------------------------------------

                 Key: JBMESSAGING-1811
                 URL: https://jira.jboss.org/browse/JBMESSAGING-1811
             Project: JBoss Messaging
          Issue Type: Bug
          Components: AS Integration
    Affects Versions: 2.0.0.beta4
            Reporter: Wendy Feng


NettyAcceptor has unefficient code as follow:
public synchronized void pause()
   {      
      ...
      try
      {
         Thread.sleep(500);
      }
      catch (Exception e)
      {         
      }
      ...     
   }

Since the pause() method has been synchronized, calling Thread.sleep() can not realease the resource to other waiting threads. It may cause poor performance or even deadlock.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list