[Asterisk-cvs] asterisk Makefile, 1.113, 1.114 asterisk.c, 1.124, 1.125

markster at lists.digium.com markster at lists.digium.com
Tue Sep 28 13:09:03 CDT 2004


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

Modified Files:
	Makefile asterisk.c 
Log Message:
Fix threads in FreeBSD (bug #2478)


Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/Makefile,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- Makefile	16 Sep 2004 18:46:39 -0000	1.113
+++ Makefile	28 Sep 2004 17:11:30 -0000	1.114
@@ -138,8 +138,8 @@
 
 ifeq (${OSARCH},FreeBSD)
 OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
-CFLAGS+=$(if ${OSVERSION}<500016,-D_THREAD_SAFE)
-LIBS+=$(if ${OSVERSION}<502102,-lc_r,-pthread)
+CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+LIBS+=$(shell if test  ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
 INCLUDE+=-I/usr/local/include
 CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
 endif # FreeBSD

Index: asterisk.c
===================================================================
RCS file: /usr/cvsroot/asterisk/asterisk.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- asterisk.c	13 Sep 2004 18:19:15 -0000	1.124
+++ asterisk.c	28 Sep 2004 17:11:30 -0000	1.125
@@ -1728,10 +1728,6 @@
 	printf(term_end());
 	fflush(stdout);
 
-	/* Test recursive mutex locking. */
-	if (test_for_thread_safety())
-		ast_verbose("Warning! Asterisk is not thread safe.\n");
-
 	if (option_console && !option_verbose) 
 		ast_verbose("[ Reading Master Configuration ]");
 	ast_readconfig();
@@ -1796,6 +1792,10 @@
 			ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno));
 	}
 
+	/* Test recursive mutex locking. */
+	if (test_for_thread_safety())
+		ast_verbose("Warning! Asterisk is not thread safe.\n");
+
 	ast_makesocket();
 	sigemptyset(&sigs);
 	sigaddset(&sigs, SIGHUP);




More information about the svn-commits mailing list