synchronizing on the session object
"Hagai Sela \(TA\)" <[email protected]>
| Newsgroups | gmane.comp.voip.nist-sip |
|---|---|
| Message-ID | <[email protected]> |
Hi, I have a nist-sip based B2BUA. I want to be able to synchronize on a session object to serialize request handling on both dialogs on the B2BUA, so if I am handling something on one dialog and a request on the other dialog comes along it will wait. This causes deadlocks, since the stack is synchronized on transaction objects before calling my listener. for example: 1. The stack receives an INVITE on dialog A, and forwards it on dialog B. 2. CANCEL is received on dialog A in thread 1. 3. My listener is called, and is synchronized on the session object (thread 1) 4. a negative response is received on dialog B in thread 2. 5. The stack is synchronized on B's INVITE client transaction in thread 2. 6. My listener is called again, tries to synchronize on the session object, and is blocked (thread 2). 7. thread 1 tries to send cancel in dialog B. getNewClientTransaction is called, and findCancelTransaction finds dialog A's invite transaction. when getDialog() is called on that transaction we have a deadlock. Should I not synchronize on any of my objects in the stack callbacks? Hagai. _______________________________________________ nist-sip mailing list [email protected] http://www-x.antd.nist.gov/mailman/listinfo/nist-sip