0 Replies Latest reply on Nov 5, 2009 2:32 AM by timfox

    Removed unnecessary volatile modifers from ServerConsumerImp

    timfox

      I reverted the addition of unnecesary volatile modifiers added in this commit:

      uthor: clebert.suconic@jboss.com
      Date: 2009-11-04 18:29:37 -0500 (Wed, 04 Nov 2009)
      New Revision: 8214
      
      Modified:
       trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
      Log:
      Fixing eventual failure on LargeMessageTest
      


      I also removed unnecessary volatile modifiers from a further two variables in LargeMessageDeliverer which were there before.

      The variables are only accessed when the lock "lock" is held, so making them volatile is unnecessary, the lock provides memory synchronization semantics, like a synchronized block does.

      See http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/Lock.html for more information, e.g.:


      Memory Synchronization

      All Lock implementations must enforce the same memory synchronization semantics as provided by the built-in monitor lock:

      * A successful lock operation acts like a successful monitorEnter action
      * A successful unlock operation acts like a successful monitorExit action