|
From: Alexander G. <ago...@ac...> - 2007-05-01 14:08:05
|
Hello, My quickfix/j 1.0.5 application runs into a deadlock. I'm using the = onLogout() callback to count the sessions that are still logged on. The = method Session.disconnect() from where the onLogout() is called is = synchronized by the Session instance. Inside the onLogout() I'm calling = the sess=3DSession.lookupSession() followed by the sess.isLoggedOn() for = every section that is returned by the SessionSettings.sectionIterator(). = The problem arises when there are 2 concurrent onLogout() calls from 2 = different Session instances. The session1 thread is calling = session2_instance.isLoggedOn() while the session2 thread is calling = session1_instance.isLoggedOn(). Since isLoggedOn() is also synchronized = by the Session instance, and since both instances are already locked, = both threads will be waiting for their locks forever. Can this be = fixed/workarrounded?=20 Thank you, Alexander Gorbachev. |