diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-02-13 15:17:28 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-02-13 15:17:28 +0000 |
commit | 379f21d67f143af70c85fd9ef2af67cc87d150e3 (patch) | |
tree | 4b20c85bf30f3d7aebbd94a3ef529e7ae9f42f59 /pjlib/src/pjlib-test/ioq_unreg.c | |
parent | a2ca31f0f6e30a30bf6f6e58ab423b370fbc9bb3 (diff) |
Ticket #474: option in ioqueue to control concurrency (to allow/disallow simultaneous/multiple callback calls)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1789 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pjlib-test/ioq_unreg.c')
-rw-r--r-- | pjlib/src/pjlib-test/ioq_unreg.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/pjlib/src/pjlib-test/ioq_unreg.c b/pjlib/src/pjlib-test/ioq_unreg.c index 33e86270..a1e80753 100644 --- a/pjlib/src/pjlib-test/ioq_unreg.c +++ b/pjlib/src/pjlib-test/ioq_unreg.c @@ -286,14 +286,16 @@ static int perform_unreg_test(pj_ioqueue_t *ioqueue, return 0; } -int udp_ioqueue_unreg_test(void) +static int udp_ioqueue_unreg_test_imp(pj_bool_t allow_concur) { enum { LOOP = 10 }; int i, rc; char title[30]; pj_ioqueue_t *ioqueue; pj_pool_t *test_pool; - + + PJ_LOG(3,(THIS_FILE, "..testing with concurency=%d", allow_concur)); + test_method = UNREGISTER_IN_APP; test_pool = pj_pool_create(mem, "unregtest", 4000, 4000, NULL); @@ -304,6 +306,11 @@ int udp_ioqueue_unreg_test(void) return -10; } + rc = pj_ioqueue_set_default_concurrency(ioqueue, allow_concur); + if (rc != PJ_SUCCESS) { + app_perror("Error in pj_ioqueue_set_default_concurrency()", rc); + return -12; + } PJ_LOG(3, (THIS_FILE, "...ioqueue unregister stress test 0/3 (%s)", pj_ioqueue_name())); @@ -351,7 +358,20 @@ int udp_ioqueue_unreg_test(void) return 0; } +int udp_ioqueue_unreg_test(void) +{ + int rc; + + rc = udp_ioqueue_unreg_test_imp(PJ_TRUE); + if (rc != 0) + return rc; + + rc = udp_ioqueue_unreg_test_imp(PJ_FALSE); + if (rc != 0) + return rc; + return 0; +} #else /* To prevent warning about "translation unit is empty" |