Ignore:
Timestamp:
Jun 5, 2012 10:41:17 AM (12 years ago)
Author:
bennylp
Message:

Re #1527: added debugging facility to the timer heap. By enabling PJ_TIMER_DEBUG, application can use pj_timer_heap_dump() or pjsip_endpt_dump() to dump the timer entries along with the source location where it is scheduled from. The macro will also enable dumping the timer heap entries when the SIP endpoint is being destroyed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r4122 r4154  
    26242624 * Schedule a timer entry.  
    26252625 */ 
     2626#if PJ_TIMER_DEBUG 
     2627PJ_DEF(pj_status_t) pjsua_schedule_timer_dbg( pj_timer_entry *entry, 
     2628                                              const pj_time_val *delay, 
     2629                                              const char *src_file, 
     2630                                              int src_line) 
     2631{ 
     2632    return pjsip_endpt_schedule_timer_dbg(pjsua_var.endpt, entry, delay, 
     2633                                          src_file, src_line); 
     2634} 
     2635#else 
    26262636PJ_DEF(pj_status_t) pjsua_schedule_timer( pj_timer_entry *entry, 
    26272637                                          const pj_time_val *delay) 
     
    26292639    return pjsip_endpt_schedule_timer(pjsua_var.endpt, entry, delay); 
    26302640} 
     2641#endif 
    26312642 
    26322643/* Timer callback */ 
     
    26512662 * Schedule a timer callback.  
    26522663 */ 
     2664#if PJ_TIMER_DEBUG 
     2665PJ_DEF(pj_status_t) pjsua_schedule_timer2_dbg( void (*cb)(void *user_data), 
     2666                                               void *user_data, 
     2667                                               unsigned msec_delay, 
     2668                                               const char *src_file, 
     2669                                               int src_line) 
     2670#else 
    26532671PJ_DEF(pj_status_t) pjsua_schedule_timer2( void (*cb)(void *user_data), 
    26542672                                           void *user_data, 
    26552673                                           unsigned msec_delay) 
     2674#endif 
    26562675{ 
    26572676    pjsua_timer_list *tmr = NULL; 
     
    26732692    delay.msec = msec_delay; 
    26742693 
     2694#if PJ_TIMER_DEBUG 
     2695    status = pjsip_endpt_schedule_timer_dbg(pjsua_var.endpt, &tmr->entry, 
     2696                                            &delay, src_file, src_line); 
     2697#else 
    26752698    status = pjsip_endpt_schedule_timer(pjsua_var.endpt, &tmr->entry, &delay); 
     2699#endif 
    26762700    if (status != PJ_SUCCESS) { 
    26772701        pj_list_push_back(&pjsua_var.timer_list, tmr); 
Note: See TracChangeset for help on using the changeset viewer.