summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2012-06-05 10:41:17 +0000
committerBenny Prijono <bennylp@teluu.com>2012-06-05 10:41:17 +0000
commit2ffba2873e85bb5c7f9fcb025f9c28c4bb738b48 (patch)
tree58e68be64c103e4e60e52c18e6df477ca3375f72 /pjsip/include/pjsip
parent1511db342e293b00656fcde74992d02b3c42046f (diff)
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
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4154 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip')
-rw-r--r--pjsip/include/pjsip/sip_endpoint.h12
-rw-r--r--pjsip/include/pjsip/sip_event.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/sip_endpoint.h b/pjsip/include/pjsip/sip_endpoint.h
index c6cf6d65..86dc9bef 100644
--- a/pjsip/include/pjsip/sip_endpoint.h
+++ b/pjsip/include/pjsip/sip_endpoint.h
@@ -150,9 +150,21 @@ PJ_DECL(pj_status_t) pjsip_endpt_handle_events2(pjsip_endpoint *endpt,
* @param delay The relative delay of the timer.
* @return PJ_OK (zero) if successfull.
*/
+#if PJ_TIMER_DEBUG
+#define pjsip_endpt_schedule_timer(ept,ent,d) \
+ pjsip_endpt_schedule_timer_dbg(ept, ent, d, \
+ __FILE__, __LINE__)
+
+PJ_DECL(pj_status_t) pjsip_endpt_schedule_timer_dbg(pjsip_endpoint *endpt,
+ pj_timer_entry *entry,
+ const pj_time_val *delay,
+ const char *src_file,
+ int src_line);
+#else
PJ_DECL(pj_status_t) pjsip_endpt_schedule_timer( pjsip_endpoint *endpt,
pj_timer_entry *entry,
const pj_time_val *delay );
+#endif
/**
* Cancel the previously registered timer.
diff --git a/pjsip/include/pjsip/sip_event.h b/pjsip/include/pjsip/sip_event.h
index cd8a76fc..4e002bc1 100644
--- a/pjsip/include/pjsip/sip_event.h
+++ b/pjsip/include/pjsip/sip_event.h
@@ -34,6 +34,7 @@ PJ_BEGIN_DECL
* @{
*/
#include <pj/types.h>
+#include <pj/timer.h>
/**