From 8cc7aef25ecc698b6fdfa620877f72e6b8dd536f Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 13 Jan 2010 13:09:45 +0000 Subject: Initial OpenBSD fixes (#994): pjlib: - Autoconf fixes in detecting header availability - Undefined sched_get_priority_max() and sched_get_priority_min() - protect with #ifdef _POSIX_PRIORITY_SCHEDULING, and - return hardcoded (0, 31) if __OpenBSD__ macro is declared - Better GUID generation pjlib-test: - Reduce the loop in PJILB activesock test - Fixed bug in ioqueue unregistration test which caused assertion error in destroying mutex pjlib-util-test: - Fixed bug in pjlib-util resolver test git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3057 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pjlib-test/activesock.c | 11 ++++++++++- pjlib/src/pjlib-test/ioq_unreg.c | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'pjlib/src/pjlib-test') diff --git a/pjlib/src/pjlib-test/activesock.c b/pjlib/src/pjlib-test/activesock.c index bcbf4598..aaa2b672 100644 --- a/pjlib/src/pjlib-test/activesock.c +++ b/pjlib/src/pjlib-test/activesock.c @@ -337,7 +337,7 @@ static pj_bool_t tcp_on_data_sent(pj_activesock_t *asock, static int tcp_perf_test(void) { - enum { COUNT=100000 }; + enum { COUNT=10000 }; pj_pool_t *pool = NULL; pj_ioqueue_t *ioqueue = NULL; pj_sock_t sock1=PJ_INVALID_SOCKET, sock2=PJ_INVALID_SOCKET; @@ -436,6 +436,15 @@ static int tcp_perf_test(void) } } } + +#ifndef PJ_SYMBIAN + for (;;) { + pj_time_val timeout = {0, 10}; + if (pj_ioqueue_poll(ioqueue, &timeout) < 1) + break; + } +#endif + } /* Wait until everything has been sent/received */ diff --git a/pjlib/src/pjlib-test/ioq_unreg.c b/pjlib/src/pjlib-test/ioq_unreg.c index 6b19ed1f..f30510d4 100644 --- a/pjlib/src/pjlib-test/ioq_unreg.c +++ b/pjlib/src/pjlib-test/ioq_unreg.c @@ -93,6 +93,7 @@ static void on_read_complete(pj_ioqueue_key_t *key, if (PJ_TIME_VAL_GTE(now, time_to_unregister)) { sock_data.unregistered = 1; pj_ioqueue_unregister(key); + pj_mutex_unlock(sock_data.mutex); return; } } -- cgit v1.2.3