[Asterisk-cvs] asterisk/channels chan_agent.c,1.73,1.74 chan_alsa.c,1.17,1.18 chan_h323.c,1.55,1.56 chan_iax.c,1.58,1.59 chan_iax2.c,1.149,1.150 chan_local.c,1.27,1.28 chan_mgcp.c,1.53,1.54 chan_modem.c,1.20,1.21 chan_modem_aopen.c,1.11,1.12 chan_modem_bestdata.c,1.9,1.10 chan_modem_i4l.c,1.13,1.14 chan_nbs.c,1.6,1.7 chan_oss.c,1.26,1.27 chan_phone.c,1.27,1.28 chan_sip.c,1.405,1.406 chan_skinny.c,1.44,1.45 chan_vofr.c,1.14,1.15 chan_vpb.c,1.25,1.26 chan_zap.c,1.258,1.259

markster at lists.digium.com markster at lists.digium.com
Tue Jun 8 20:42:08 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv11896/channels

Modified Files:
	chan_agent.c chan_alsa.c chan_h323.c chan_iax.c chan_iax2.c 
	chan_local.c chan_mgcp.c chan_modem.c chan_modem_aopen.c 
	chan_modem_bestdata.c chan_modem_i4l.c chan_nbs.c chan_oss.c 
	chan_phone.c chan_sip.c chan_skinny.c chan_vofr.c chan_vpb.c 
	chan_zap.c 
Log Message:
Merge FreeBSD locking fixes (bug #1411)


Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- chan_agent.c	3 Jun 2004 17:33:35 -0000	1.73
+++ chan_agent.c	9 Jun 2004 01:45:07 -0000	1.74
@@ -91,10 +91,10 @@
 static int ackcall;
 
 static int usecnt =0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the interface list (of sip_pvt's) */
-static ast_mutex_t agentlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(agentlock);
 
 static int recordagentcalls = 0;
 static char recordformat[AST_MAX_BUF];

Index: chan_alsa.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_alsa.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- chan_alsa.c	11 Apr 2004 01:59:11 -0000	1.17
+++ chan_alsa.c	9 Jun 2004 01:45:07 -0000	1.18
@@ -77,7 +77,7 @@
 static char digits[80] = "";
 static char text2send[80] = "";
 
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 static char *type = "Console";
 static char *desc = "ALSA Console Channel Driver";

Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- chan_h323.c	27 May 2004 04:18:45 -0000	1.55
+++ chan_h323.c	9 Jun 2004 01:45:07 -0000	1.56
@@ -141,15 +141,15 @@
 static struct io_context *io;
 
 /** Protect the interface list (of oh323_pvt's) */
-static ast_mutex_t iflock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(iflock);
 
 /** Usage counter and associated lock */
 static int usecnt =0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */

Index: chan_iax.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- chan_iax.c	9 May 2004 08:22:15 -0000	1.58
+++ chan_iax.c	9 Jun 2004 01:45:07 -0000	1.59
@@ -80,7 +80,7 @@
 #define GAMMA (0.01)
 
 #ifdef MYSQL_FRIENDS
-static ast_mutex_t mysqllock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(mysqllock);
 static MYSQL *mysql;
 static char mydbuser[80];
 static char mydbpass[80];
@@ -112,7 +112,7 @@
 static int expirey = AST_DEFAULT_REG_EXPIRE;
 
 static int usecnt;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 int (*iax_regfunk)(char *username, int onoff) = NULL;
 

Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -d -r1.149 -r1.150
--- chan_iax2.c	7 Jun 2004 19:48:53 -0000	1.149
+++ chan_iax2.c	9 Jun 2004 01:45:07 -0000	1.150
@@ -100,7 +100,7 @@
 #define GAMMA (0.01)
 
 #ifdef MYSQL_FRIENDS
-static ast_mutex_t mysqllock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(mysqllock);
 static MYSQL *mysql;
 static char mydbuser[80];
 static char mydbpass[80];
@@ -138,7 +138,7 @@
 static int timingfd = -1;				/* Timing file descriptor */
 
 static int usecnt;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 int (*iax2_regfunk)(char *username, int onoff) = NULL;
 
@@ -269,7 +269,7 @@
 	int calls;
 } *tpeers = NULL;
 
-static ast_mutex_t tpeerlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(tpeerlock);
 
 struct iax_firmware {
 	struct iax_firmware *next;

Index: chan_local.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_local.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- chan_local.c	17 May 2004 15:52:33 -0000	1.27
+++ chan_local.c	9 Jun 2004 01:45:07 -0000	1.28
@@ -49,12 +49,12 @@
 static int capability = -1;
 
 static int usecnt =0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 #define IS_OUTBOUND(a,b) (a == b->chan ? 1 : 0)
 
 /* Protect the interface list (of sip_pvt's) */
-static ast_mutex_t locallock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(locallock);
 
 static struct local_pvt {
 	ast_mutex_t lock;				/* Channel private lock */

Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- chan_mgcp.c	27 May 2004 04:18:46 -0000	1.53
+++ chan_mgcp.c	9 Jun 2004 01:45:07 -0000	1.54
@@ -199,7 +199,7 @@
 
 
 static int usecnt =0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 /* SC: transaction id should always be positive */
 static unsigned int oseq;
 
@@ -214,9 +214,9 @@
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t netlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(netlock);
 
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */
@@ -419,10 +419,10 @@
 	struct mgcp_gateway *next;
 } *gateways;
 
-static ast_mutex_t mgcp_reload_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(mgcp_reload_lock);
 static int mgcp_reloading = 0;
 
-static ast_mutex_t gatelock  = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(gatelock);
 
 static int mgcpsock  = -1;
 

Index: chan_modem.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- chan_modem.c	15 Mar 2004 07:51:22 -0000	1.20
+++ chan_modem.c	9 Jun 2004 01:45:08 -0000	1.21
@@ -72,14 +72,14 @@
 
 static int stripmsd = 0;
 
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the interface list (of ast_modem_pvt's) */
-static ast_mutex_t iflock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(iflock);
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */

Index: chan_modem_aopen.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem_aopen.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- chan_modem_aopen.c	13 Aug 2003 15:25:16 -0000	1.11
+++ chan_modem_aopen.c	9 Jun 2004 01:45:08 -0000	1.12
@@ -34,7 +34,7 @@
 static char *desc = "A/Open (Rockwell Chipset) ITU-2 VoiceModem Driver";
 
 static int usecnt;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 static char *aopen_idents[] = {
 	/* Identify A/Open Modem */

Index: chan_modem_bestdata.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem_bestdata.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- chan_modem_bestdata.c	13 Aug 2003 15:25:16 -0000	1.9
+++ chan_modem_bestdata.c	9 Jun 2004 01:45:08 -0000	1.10
@@ -39,7 +39,7 @@
 static char *desc = "BestData (Conexant V.90 Chipset) VoiceModem Driver";
 
 static int usecnt;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 static char *bestdata_idents[] = {
 	/* Identify BestData Modem */

Index: chan_modem_i4l.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem_i4l.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- chan_modem_i4l.c	11 May 2004 15:00:28 -0000	1.13
+++ chan_modem_i4l.c	9 Jun 2004 01:45:08 -0000	1.14
@@ -34,7 +34,7 @@
 static char *desc = "ISDN4Linux Emulated Modem Driver";
 
 static int usecnt;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 static char *i4l_idents[] = {
 	/* Identify ISDN4Linux Driver */

Index: chan_nbs.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_nbs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- chan_nbs.c	6 Apr 2004 22:17:31 -0000	1.6
+++ chan_nbs.c	9 Jun 2004 01:45:08 -0000	1.7
@@ -41,7 +41,7 @@
 /* Only linear is allowed */
 static int prefformat = AST_FORMAT_SLINEAR;
 
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 static char context[AST_MAX_EXTENSION] = "default";
 

Index: chan_oss.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_oss.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- chan_oss.c	27 May 2004 22:12:55 -0000	1.26
+++ chan_oss.c	9 Jun 2004 01:45:08 -0000	1.27
@@ -70,7 +70,7 @@
 static int silencethreshold = 1000;
 
 
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 static char *type = "Console";
 static char *desc = "OSS Console Channel Driver";

Index: chan_phone.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_phone.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- chan_phone.c	8 Jun 2004 01:50:57 -0000	1.27
+++ chan_phone.c	9 Jun 2004 01:45:08 -0000	1.28
@@ -76,14 +76,14 @@
 
 static int prefformat = AST_FORMAT_G723_1 | AST_FORMAT_SLINEAR | AST_FORMAT_ULAW;
 
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the interface list (of phone_pvt's) */
-static ast_mutex_t iflock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(iflock);
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */

Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.405
retrieving revision 1.406
diff -u -d -r1.405 -r1.406
--- chan_sip.c	30 May 2004 20:03:39 -0000	1.405
+++ chan_sip.c	9 Jun 2004 01:45:08 -0000	1.406
@@ -108,7 +108,7 @@
 /* MYSQL_FRIENDS: Check if peer exists in database and read some configuration
    from databse (not all options supported though) */
 #ifdef MYSQL_FRIENDS
-static ast_mutex_t mysqllock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(mysqllock);
 static MYSQL *mysql;
 static char mydbuser[80];
 static char mydbpass[80];
@@ -155,16 +155,16 @@
 static int globalrtpholdtimeout = 0;
 
 static int usecnt =0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the interface list (of sip_pvt's) */
-static ast_mutex_t iflock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(iflock);
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t netlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(netlock);
 
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */
@@ -430,7 +430,7 @@
 	struct sip_peer *next;
 };
 
-static ast_mutex_t sip_reload_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(sip_reload_lock);
 static int sip_reloading = 0;
 
 #define REG_STATE_UNREGISTERED 0
@@ -467,20 +467,20 @@
 static struct ast_user_list {
 	struct sip_user *users;
 	ast_mutex_t lock;
-} userl = { NULL, AST_MUTEX_INITIALIZER };
+} userl;
 
 /*--- The peer list: Peers and Friends ---*/
 static struct ast_peer_list {
 	struct sip_peer *peers;
 	ast_mutex_t lock;
-} peerl = { NULL, AST_MUTEX_INITIALIZER };
+} peerl;
 
 /*--- The register list: Other SIP proxys we register with and call ---*/
 static struct ast_register_list {
 	struct sip_registry *registrations;
 	ast_mutex_t lock;
 	int recheck;
-} regl = { NULL, AST_MUTEX_INITIALIZER };
+} regl;
 
 
 #define REINVITE_INVITE		1
@@ -1368,6 +1368,7 @@
 				ast_sched_del(sched, cp->retransid);
 			free(cp);
 		}
+                ast_mutex_destroy(&p->lock);
 		free(p);
 	}
 }
@@ -2018,6 +2019,7 @@
 	struct sip_pvt *p;
 
 	p = malloc(sizeof(struct sip_pvt));
+        ast_mutex_init(&p->lock);
 	if (!p)
 		return NULL;
 	/* Keep track of stuff */
@@ -2035,6 +2037,7 @@
 	p->ocseq = 101;
 	if (!p->rtp) {
 		ast_log(LOG_WARNING, "Unable to create RTP session: %s\n", strerror(errno));
+                ast_mutex_destroy(&p->lock);
 		free(p);
 		return NULL;
 	}
@@ -2049,7 +2052,6 @@
 		if (p->vrtp)
 			ast_rtp_setnat(p->vrtp, p->nat);
 	}
-	ast_mutex_init(&p->lock);
 
 	if (sin) {
 		memcpy(&p->sa, sin, sizeof(p->sa));
@@ -8039,6 +8041,10 @@
 	int res;
 	struct sip_peer *peer;
 	struct sip_registry *reg;
+
+        ast_mutex_init(&userl.lock);
+        ast_mutex_init(&peerl.lock);
+        ast_mutex_init(&regl.lock);
 	sched = sched_context_create();
 	if (!sched) {
 		ast_log(LOG_WARNING, "Unable to create schedule context\n");

Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- chan_skinny.c	31 May 2004 02:49:53 -0000	1.44
+++ chan_skinny.c	9 Jun 2004 01:45:08 -0000	1.45
@@ -585,17 +585,17 @@
 
 /* usage count and locking */
 static int usecnt = 0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 /* Protect the network socket */
-static ast_mutex_t netlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(netlock);
 /* Protect the session list */
-static ast_mutex_t sessionlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(sessionlock);
 /* Protect the device list */
-static ast_mutex_t devicelock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(devicelock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */

Index: chan_vofr.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_vofr.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- chan_vofr.c	15 Mar 2004 09:14:16 -0000	1.14
+++ chan_vofr.c	9 Jun 2004 01:45:08 -0000	1.15
@@ -53,14 +53,14 @@
 static char language[MAX_LANGUAGE] = "";
 
 static int usecnt =0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the interface list (of vofr_pvt's) */
-static ast_mutex_t iflock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(iflock);
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */

Index: chan_vpb.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_vpb.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- chan_vpb.c	26 May 2004 01:29:29 -0000	1.25
+++ chan_vpb.c	9 Jun 2004 01:45:08 -0000	1.26
@@ -69,14 +69,14 @@
 
 static const int prefformat = AST_FORMAT_SLINEAR;
 
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the interface list (of vpb_pvt's) */
-static ast_mutex_t iflock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(iflock);
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */
@@ -171,7 +171,7 @@
 static vpb_bridge_t * bridges;
 static int max_bridges = MAX_BRIDGES_V4PCI;
 
-static ast_mutex_t bridge_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(bridge_lock);
 
 typedef enum {
 	vpb_model_unknown = 0, 

Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -d -r1.258 -r1.259
--- chan_zap.c	8 Jun 2004 22:34:25 -0000	1.258
+++ chan_zap.c	9 Jun 2004 01:45:08 -0000	1.259
@@ -241,16 +241,16 @@
 static int matchdigittimeout = 3000;
 
 static int usecnt =0;
-static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(usecnt_lock);
 
 /* Protect the interface list (of zt_pvt's) */
-static ast_mutex_t iflock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(iflock);
 
 static int ifcount = 0;
 
 /* Protect the monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
-static ast_mutex_t monlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(monlock);
 
 /* This is the thread for the monitor which checks for input on the channels
    which are not currently in use.  */




More information about the svn-commits mailing list