Changeset 5312

Show
Ignore:
Timestamp:
08/23/10 18:07:41 (18 months ago)
Author:
mtld
Message:

sessionstatuslistener race condition fix, fixed webservices-core lib

Location:
branches/release-0.13.5-before-modinc/pfixcore
Files:
1 added
1 removed
3 modified

Legend:

Unmodified
Added
Removed
  • branches/release-0.13.5-before-modinc/pfixcore

  • branches/release-0.13.5-before-modinc/pfixcore/ChangeLog

    r4662 r5312  
     12009-07-27  Martin Leidig  <mleidig@schlund.de> 
     2 
     3        Fixed possible deadlock within SessionEndNotificator when 
     4        one thread adds a SessionListener after getting a lock to an  
     5        application object, while another thread is invalidating  
     6        the session and calls a registered SessionListener, which itself 
     7        tries to lock the same application object. 
     8 
    192009-06-25  Martin Leidig  <mleidig@schlund.de> 
    210 
  • branches/release-0.13.5-before-modinc/pfixcore/src/de/schlund/pfixcore/workflow/context/SessionContextImpl.java

    r4202 r5312  
    6161            // Send event to registered listeners 
    6262            try { 
     63                SessionStatusListener[] currentListeners; 
    6364                synchronized (this) { 
    64                     for (SessionStatusListener l : sessionListeners) { 
    65                         l.sessionStatusChanged(new SessionStatusEvent(SessionStatusEvent.Type.SESSION_DESTROYED)); 
    66                     } 
     65                    currentListeners = new SessionStatusListener[sessionListeners.size()]; 
     66                    sessionListeners.toArray(currentListeners); 
     67                } 
     68                for (SessionStatusListener l : currentListeners) { 
     69                    l.sessionStatusChanged(new SessionStatusEvent(SessionStatusEvent.Type.SESSION_DESTROYED)); 
    6770                } 
    6871            } catch(Throwable t) {