diff options
author | Jason Parker <jparker@digium.com> | 2007-06-20 22:32:57 +0000 |
---|---|---|
committer | Jason Parker <jparker@digium.com> | 2007-06-20 22:32:57 +0000 |
commit | a5d03568e56c6c672e3bf409cd7997ef7fbd6121 (patch) | |
tree | 6451d5d7273a7eb384a3c14f21f7e1875ee81ab0 /cdr/cdr_pgsql.c | |
parent | 18f492022737fa604644a6a4b43704331d92eb82 (diff) |
Merged revisions 70554 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r70554 | qwell | 2007-06-20 17:31:35 -0500 (Wed, 20 Jun 2007) | 4 lines
Fix a race condition in cdr_pgsql that can occur when reloading the module.
Issue 10022, patch by me, with credit to prashant_jois for finding the bug.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr/cdr_pgsql.c')
-rw-r--r-- | cdr/cdr_pgsql.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c index 09df1bfd7..ac0373cb2 100644 --- a/cdr/cdr_pgsql.c +++ b/cdr/cdr_pgsql.c @@ -309,8 +309,12 @@ static int unload_module(void) static int reload(void) { + int res; + ast_mutex_lock(&pgsql_lock); my_unload_module(); - return my_load_module(); + res = my_load_module(); + ast_mutex_lock(&pgsql_lock); + return res; } AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "PostgreSQL CDR Backend", |