From 379f21d67f143af70c85fd9ef2af67cc87d150e3 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 13 Feb 2008 15:17:28 +0000 Subject: 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 --- pjlib/src/pjlib-test/ioq_perf.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'pjlib/src/pjlib-test/ioq_perf.c') diff --git a/pjlib/src/pjlib-test/ioq_perf.c b/pjlib/src/pjlib-test/ioq_perf.c index 92d4540d..e7ddf1f4 100644 --- a/pjlib/src/pjlib-test/ioq_perf.c +++ b/pjlib/src/pjlib-test/ioq_perf.c @@ -221,7 +221,8 @@ static int worker_thread(void *p) * - measure the total bytes received by all consumers during a * period of time. */ -static int perform_test(int sock_type, const char *type_name, +static int perform_test(pj_bool_t allow_concur, + int sock_type, const char *type_name, unsigned thread_cnt, unsigned sockpair_cnt, pj_size_t buffer_size, pj_size_t *p_bandwidth) @@ -260,6 +261,12 @@ static int perform_test(int sock_type, const char *type_name, return -15; } + rc = pj_ioqueue_set_default_concurrency(ioqueue, allow_concur); + if (rc != PJ_SUCCESS) { + app_perror("...error: pj_ioqueue_set_default_concurrency()", rc); + return -16; + } + /* Initialize each producer-consumer pair. */ for (i=0; i