[svn-commits] russell: branch russell/project_docs r162417 - in /team/russell/project_docs:...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Dec 9 16:36:10 CST 2008


Author: russell
Date: Tue Dec  9 16:36:09 2008
New Revision: 162417

URL: http://svn.digium.com/view/asterisk?view=rev&rev=162417
Log:
sync with trunk

Modified:
    team/russell/project_docs/   (props changed)
    team/russell/project_docs/include/asterisk/utils.h
    team/russell/project_docs/main/asterisk.c
    team/russell/project_docs/main/utils.c

Propchange: team/russell/project_docs/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/russell/project_docs/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Dec  9 16:36:09 2008
@@ -1,1 +1,1 @@
-/trunk:1-162398
+/trunk:1-162416

Modified: team/russell/project_docs/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/team/russell/project_docs/include/asterisk/utils.h?view=diff&rev=162417&r1=162416&r2=162417
==============================================================================
--- team/russell/project_docs/include/asterisk/utils.h (original)
+++ team/russell/project_docs/include/asterisk/utils.h Tue Dec  9 16:36:09 2008
@@ -306,8 +306,6 @@
 {
 	*input /= *value;
 }
-
-int test_for_thread_safety(void);
 
 #ifdef localtime_r
 #undef localtime_r

Modified: team/russell/project_docs/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/russell/project_docs/main/asterisk.c?view=diff&rev=162417&r1=162416&r2=162417
==============================================================================
--- team/russell/project_docs/main/asterisk.c (original)
+++ team/russell/project_docs/main/asterisk.c Tue Dec  9 16:36:09 2008
@@ -3303,10 +3303,6 @@
 	}
 #endif
 
-	/* Test recursive mutex locking. */
-	if (test_for_thread_safety())
-		ast_verbose("Warning! Asterisk is not thread safe.\n");
-
 	ast_event_init();
 
 	ast_makesocket();

Modified: team/russell/project_docs/main/utils.c
URL: http://svn.digium.com/view/asterisk/team/russell/project_docs/main/utils.c?view=diff&rev=162417&r1=162416&r2=162417
==============================================================================
--- team/russell/project_docs/main/utils.c (original)
+++ team/russell/project_docs/main/utils.c Tue Dec  9 16:36:09 2008
@@ -224,68 +224,6 @@
 		return NULL;
 #endif
 	return &hp->hp;
-}
-
-
-
-AST_MUTEX_DEFINE_STATIC(test_lock);
-AST_MUTEX_DEFINE_STATIC(test_lock2);
-static pthread_t test_thread; 
-static int lock_count = 0;
-static int test_errors = 0;
-
-/*! \brief This is a regression test for recursive mutexes.
-   test_for_thread_safety() will return 0 if recursive mutex locks are
-   working properly, and non-zero if they are not working properly. */
-static void *test_thread_body(void *data) 
-{ 
-	ast_mutex_lock(&test_lock);
-	lock_count += 10;
-	if (lock_count != 10) 
-		test_errors++;
-	ast_mutex_lock(&test_lock);
-	lock_count += 10;
-	if (lock_count != 20) 
-		test_errors++;
-	ast_mutex_lock(&test_lock2);
-	ast_mutex_unlock(&test_lock);
-	lock_count -= 10;
-	if (lock_count != 10) 
-		test_errors++;
-	ast_mutex_unlock(&test_lock);
-	lock_count -= 10;
-	ast_mutex_unlock(&test_lock2);
-	if (lock_count != 0) 
-		test_errors++;
-	return NULL;
-} 
-
-int test_for_thread_safety(void)
-{ 
-	ast_mutex_lock(&test_lock2);
-	ast_mutex_lock(&test_lock);
-	lock_count += 1;
-	ast_mutex_lock(&test_lock);
-	lock_count += 1;
-	ast_pthread_create(&test_thread, NULL, test_thread_body, NULL); 
-	usleep(100);
-	if (lock_count != 2) 
-		test_errors++;
-	ast_mutex_unlock(&test_lock);
-	lock_count -= 1;
-	usleep(100); 
-	if (lock_count != 1) 
-		test_errors++;
-	ast_mutex_unlock(&test_lock);
-	lock_count -= 1;
-	if (lock_count != 0) 
-		test_errors++;
-	ast_mutex_unlock(&test_lock2);
-	usleep(100);
-	if (lock_count != 0) 
-		test_errors++;
-	pthread_join(test_thread, NULL);
-	return(test_errors);          /* return 0 on success. */
 }
 
 /*! \brief Produce 32 char MD5 hash of value. */




More information about the svn-commits mailing list