Changeset 671 for pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
- Timestamp:
- Aug 10, 2006 9:44:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
r624 r671 210 210 211 211 212 /** 213 * Lock the dialog's hash table. This function is normally called by 214 * dialog code only. 215 * 216 * @return PJ_SUCCESS on success or the appropriate error code. 217 */ 218 PJ_DEF(pj_status_t) pjsip_ua_lock_dlg_table(void) 219 { 220 return pj_mutex_lock(mod_ua.mutex); 221 } 222 223 224 /** 225 * Unlock the dialog's hash table. This function is normally called by 226 * dialog code only. 227 * 228 * @return PJ_SUCCESS on success or the appropriate error code. 229 */ 230 PJ_DEF(pj_status_t) pjsip_ua_unlock_dlg_table(void) 231 { 232 return pj_mutex_unlock(mod_ua.mutex); 233 } 234 235 212 236 /* 213 237 * Get the endpoint where this UA is currently registered. … … 562 586 rdata->endpt_info.mod_data[mod_ua.mod.id] = dlg; 563 587 588 /* Lock the dialog */ 589 pjsip_dlg_inc_lock(dlg); 590 564 591 /* Done processing in the UA */ 565 592 pj_mutex_unlock(mod_ua.mutex); … … 567 594 /* Pass to dialog. */ 568 595 pjsip_dlg_on_rx_request(dlg, rdata); 596 597 /* Unlock the dialog. This may destroy the dialog */ 598 pjsip_dlg_dec_lock(dlg); 569 599 570 600 /* Report as handled. */ … … 591 621 */ 592 622 623 /* Lock user agent dlg table before we're doing anything. */ 624 pj_mutex_lock(mod_ua.mutex); 625 593 626 /* Check if transaction is present. */ 594 627 tsx = pjsip_rdata_get_tsx(rdata); … … 596 629 /* Check if dialog is present in the transaction. */ 597 630 dlg = pjsip_tsx_get_dlg(tsx); 598 if (!dlg) 631 if (!dlg) { 632 /* Unlock dialog hash table. */ 633 pj_mutex_unlock(mod_ua.mutex); 599 634 return PJ_FALSE; 635 } 600 636 601 637 /* Get the dialog set. */ … … 621 657 * or a very late response. 622 658 */ 659 /* Unlock dialog hash table. */ 660 pj_mutex_unlock(mod_ua.mutex); 623 661 return PJ_FALSE; 624 662 } 625 663 626 /* Lock user agent before accessing the hash table. */627 pj_mutex_lock(mod_ua.mutex);628 664 629 665 /* Get the dialog set. */ … … 633 669 NULL); 634 670 635 /* Done with accessing the hash table. */636 pj_mutex_unlock(mod_ua.mutex);637 638 671 if (!dlg_set) { 672 /* Unlock dialog hash table. */ 673 pj_mutex_unlock(mod_ua.mutex); 674 639 675 /* Strayed 2xx response!! */ 640 676 PJ_LOG(4,(THIS_FILE, … … 666 702 int st_code = rdata->msg_info.msg->line.status.code; 667 703 pj_str_t *to_tag = &rdata->msg_info.to->tag; 668 669 /* Must hold UA mutex before accessing dialog set. */670 pj_mutex_lock(mod_ua.mutex);671 704 672 705 dlg = dlg_set->dlg_list.next; … … 734 767 } 735 768 736 /* Done with the dialog set. */737 pj_mutex_unlock(mod_ua.mutex);738 739 769 } else { 740 770 /* Either this is a non-INVITE response, or subsequent INVITE … … 752 782 rdata->endpt_info.mod_data[mod_ua.mod.id] = dlg; 753 783 784 /* Acquire lock to the dialog. */ 785 pjsip_dlg_inc_lock(dlg); 786 787 /* Unlock dialog hash table. */ 788 pj_mutex_unlock(mod_ua.mutex); 789 754 790 /* Pass the response to the dialog. */ 755 791 pjsip_dlg_on_rx_response(dlg, rdata); 792 793 /* Unlock the dialog. This may destroy the dialog. */ 794 pjsip_dlg_dec_lock(dlg); 756 795 757 796 /* Done. */
Note: See TracChangeset
for help on using the changeset viewer.