[Asterisk-cvs] asterisk asterisk.c,1.51.2.6,1.51.2.7 autoservice.c,1.3,1.3.2.1

citats at lists.digium.com citats at lists.digium.com
Mon Mar 15 02:58:57 CST 2004


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

Modified Files:
      Tag: v1-0_stable
	asterisk.c autoservice.c 
Log Message:
Fix bug 1217.  Change pthread_t initializers to AST_PTHREADT_NULL and
AST_PTHREADT_STOP



Index: asterisk.c
===================================================================
RCS file: /usr/cvsroot/asterisk/asterisk.c,v
retrieving revision 1.51.2.6
retrieving revision 1.51.2.7
diff -u -d -r1.51.2.6 -r1.51.2.7
--- asterisk.c	4 Mar 2004 21:34:32 -0000	1.51.2.6
+++ asterisk.c	15 Mar 2004 07:53:02 -0000	1.51.2.7
@@ -34,7 +34,7 @@
 #include <signal.h>
 #include <sched.h>
 #include <asterisk/io.h>
-#include <pthread.h>
+#include <asterisk/lock.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/select.h>
@@ -109,7 +109,7 @@
 static char *_argv[256];
 static int shuttingdown = 0;
 static int restartnow = 0;
-static pthread_t consolethread = (pthread_t) -1;
+static pthread_t consolethread = AST_PTHREADT_NULL;
 
 int ast_register_atexit(void (*func)(void))
 {
@@ -544,7 +544,7 @@
 		restartnow = 1;
 		/* If there is a consolethread running send it a SIGHUP 
 		   so it can execvp, otherwise we can do it ourselves */
-		if (consolethread != (pthread_t) -1) {
+		if (consolethread != AST_PTHREADT_NULL) {
 			pthread_kill(consolethread, SIGHUP);
 			/* Give the signal handler some time to complete */
 			sleep(2);
@@ -591,7 +591,7 @@
 	fflush(stdout);
 	if (complete)
 	/* Wake up a select()ing console */
-		if (option_console && consolethread != (pthread_t) -1)
+		if (option_console && consolethread != AST_PTHREADT_NULL)
 			pthread_kill(consolethread, SIGURG);
 }
 

Index: autoservice.c
===================================================================
RCS file: /usr/cvsroot/asterisk/autoservice.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -d -r1.3 -r1.3.2.1
--- autoservice.c	8 Sep 2003 16:48:06 -0000	1.3
+++ autoservice.c	15 Mar 2004 07:53:02 -0000	1.3.2.1
@@ -44,7 +44,7 @@
 };
 
 static struct asent *aslist = NULL;
-static pthread_t asthread = (pthread_t) -1;
+static pthread_t asthread = AST_PTHREADT_NULL;
 
 static void *autoservice_run(void *ign)
 {
@@ -80,7 +80,7 @@
 				ast_frfree(f);
 		}
 	}
-	asthread = (pthread_t) -1;
+	asthread = AST_PTHREADT_NULL;
 	return NULL;
 }
 
@@ -90,7 +90,7 @@
 	struct asent *as;
 	int needstart;
 	ast_mutex_lock(&autolock);
-	needstart = (asthread == (pthread_t) -1) ? 1 : 0 /* aslist ? 0 : 1 */;
+	needstart = (asthread == AST_PTHREADT_NULL) ? 1 : 0 /* aslist ? 0 : 1 */;
 	as = aslist;
 	while(as) {
 		if (as->chan == chan)
@@ -142,7 +142,7 @@
 		if (!chan->_softhangup)
 			res = 0;
 	}
-	if (asthread != (pthread_t) -1) 
+	if (asthread != AST_PTHREADT_NULL) 
 		pthread_kill(asthread, SIGURG);
 	ast_mutex_unlock(&autolock);
 	/* Wait for it to un-block */




More information about the svn-commits mailing list