diff options
author | Benny Prijono <bennylp@teluu.com> | 2013-03-05 11:59:54 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2013-03-05 11:59:54 +0000 |
commit | 22da209226aac2c65f45900e55cf5f162cd311d4 (patch) | |
tree | 6ab301e7c4b749be0683e50760c8b50da1c9e5e2 /pjsip/src/test/tsx_bench.c | |
parent | 1f3242dc1324388f45e1ed939d7656352dd92f7e (diff) |
Implementation of Re #1628: Modify SIP transaction to use group lock to avoid deadlock etc.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4420 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/test/tsx_bench.c')
-rw-r--r-- | pjsip/src/test/tsx_bench.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pjsip/src/test/tsx_bench.c b/pjsip/src/test/tsx_bench.c index 8ae57783..2282b6a9 100644 --- a/pjsip/src/test/tsx_bench.c +++ b/pjsip/src/test/tsx_bench.c @@ -79,8 +79,13 @@ static int uac_tsx_bench(unsigned working_set, pj_timestamp *p_elapsed) on_error: for (i=0; i<working_set; ++i) { if (tsx[i]) { + pj_timer_heap_t *th; + pjsip_tsx_terminate(tsx[i], 601); tsx[i] = NULL; + + th = pjsip_endpt_get_timer_heap(endpt); + pj_timer_heap_poll(th, NULL); } } pjsip_tx_data_dec_ref(request); @@ -177,8 +182,14 @@ static int uas_tsx_bench(unsigned working_set, pj_timestamp *p_elapsed) on_error: for (i=0; i<working_set; ++i) { if (tsx[i]) { + pj_timer_heap_t *th; + pjsip_tsx_terminate(tsx[i], 601); tsx[i] = NULL; + + th = pjsip_endpt_get_timer_heap(endpt); + pj_timer_heap_poll(th, NULL); + } } pjsip_tx_data_dec_ref(request); @@ -208,6 +219,8 @@ int tsx_bench(void) for (i=0; i<REPEAT; ++i) { PJ_LOG(3,(THIS_FILE, " test %d of %d..", i+1, REPEAT)); + PJ_LOG(3,(THIS_FILE, " number of current tsx: %d", + pjsip_tsx_layer_get_tsx_count())); status = uac_tsx_bench(WORKING_SET, &usec[i]); if (status != PJ_SUCCESS) return status; @@ -246,6 +259,8 @@ int tsx_bench(void) for (i=0; i<REPEAT; ++i) { PJ_LOG(3,(THIS_FILE, " test %d of %d..", i+1, REPEAT)); + PJ_LOG(3,(THIS_FILE, " number of current tsx: %d", + pjsip_tsx_layer_get_tsx_count())); status = uas_tsx_bench(WORKING_SET, &usec[i]); if (status != PJ_SUCCESS) return status; |