ammulder    2003/11/15 15:02:30

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/service
                        AbstractManagedObject2.java
  Log:
  Synchronize around getting the next sequence number for a notification,
    but still not around firing the notification itself.
  
  Revision  Changes    Path
  1.3       +6 -2      
incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service/AbstractManagedObject2.java
  
  Index: AbstractManagedObject2.java
  ===================================================================
  RCS file: 
/home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service/AbstractManagedObject2.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractManagedObject2.java       9 Nov 2003 19:42:39 -0000       1.2
  +++ AbstractManagedObject2.java       15 Nov 2003 23:02:30 -0000      1.3
  @@ -286,7 +286,11 @@
        */
       public final void sendNotification(String type) {
           assert !Thread.holdsLock(this): "This method cannot be called while 
holding a syncrhonized lock on this";
  -        notificationBroadcaster.sendNotification(new Notification(type, 
objectName, sequenceNumber++));
  +        long seq;
  +        synchronized(this) {
  +            seq = sequenceNumber++;
  +        }
  +        notificationBroadcaster.sendNotification(new Notification(type, 
objectName, seq));
       }
   
       public void sendNotification(Notification notification) {
  
  
  

Reply via email to