diff options
author | Joshua Colp <jcolp@digium.com> | 2012-07-02 00:35:40 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2012-07-02 00:35:40 +0000 |
commit | c48d346d55a02f6a51c30232e71ed8e336ec436b (patch) | |
tree | 419bc82178e1d08a80cfff18344c82c518dcf1cf /res | |
parent | 09eb25272106ee7d8578869783f88b80ad116226 (diff) |
Ensure the timer heap is protected by a lock.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_rtp_asterisk.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 0d12aa93c..0756319de 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -3741,6 +3741,8 @@ static int reload_module(void) static int load_module(void) { + pj_lock_t *lock; + pj_log_set_level(0); if (pj_init() != PJ_SUCCESS) { @@ -3767,6 +3769,14 @@ static int load_module(void) return AST_MODULE_LOAD_DECLINE; } + if (pj_lock_create_recursive_mutex(pool, "rtp%p", &lock) != PJ_SUCCESS) { + pj_caching_pool_destroy(&cachingpool); + pj_shutdown(); + return AST_MODULE_LOAD_DECLINE; + } + + pj_timer_heap_set_lock(timerheap, lock, PJ_TRUE); + if (pj_ioqueue_create(pool, 16, &ioqueue) != PJ_SUCCESS) { pj_caching_pool_destroy(&cachingpool); pj_shutdown(); |