Show
Ignore:
Timestamp:
07/27/09 14:56:35 (3 years ago)
Author:
mtld
Message:

SessionEndNotificator? deadlock fix

Location:
branches/release-0.13.x/pfixcore
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/release-0.13.x/pfixcore/ChangeLog

    r4703 r4749  
     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-07-09  Martin Leidig  <mleidig@schlund.de> 
    210 
  • branches/release-0.13.x/pfixcore/src/de/schlund/pfixcore/workflow/context/SessionContextImpl.java

    r4200 r4749  
    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) {