[asterisk-commits] tilghman: branch 1.6.0 r118130 - in /branches/1.6.0: ./ res/res_odbc.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 23 13:15:41 CDT 2008


Author: tilghman
Date: Fri May 23 13:15:41 2008
New Revision: 118130

URL: http://svn.digium.com/view/asterisk?view=rev&rev=118130
Log:
Merged revisions 118129 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r118129 | tilghman | 2008-05-23 13:09:14 -0500 (Fri, 23 May 2008) | 3 lines

Protect the object from changing while the 'odbc show' CLI command is running
(Closes issue #12704)

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/res/res_odbc.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/res/res_odbc.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_odbc.c?view=diff&rev=118130&r1=118129&r2=118130
==============================================================================
--- branches/1.6.0/res/res_odbc.c (original)
+++ branches/1.6.0/res/res_odbc.c Fri May 23 13:15:41 2008
@@ -391,7 +391,9 @@
 				ast_cli(a->fd, "  Pooled: Yes\n  Limit:  %d\n  Connections in use: %d\n", class->limit, class->count);
 
 				AST_LIST_TRAVERSE(&(class->odbc_obj), current, list) {
+					ast_mutex_lock(&current->lock);
 					ast_cli(a->fd, "    - Connection %d: %s\n", ++count, current->used ? "in use" : current->up && ast_odbc_sanity_check(current) ? "connected" : "disconnected");
+					ast_mutex_unlock(&current->lock);
 				}
 			} else {
 				/* Should only ever be one of these */
@@ -465,7 +467,9 @@
 		/* Recycle connections before building another */
 		AST_LIST_TRAVERSE(&class->odbc_obj, obj, list) {
 			if (! obj->used) {
+				ast_mutex_lock(&obj->lock);
 				obj->used = 1;
+				ast_mutex_unlock(&obj->lock);
 				break;
 			}
 		}




More information about the asterisk-commits mailing list