[asterisk-commits] file: trunk r396621 - in /trunk: ./ tests/test_hashtab_thrash.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 14 13:10:09 CDT 2013


Author: file
Date: Wed Aug 14 13:10:08 2013
New Revision: 396621

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396621
Log:
Tweak test_hashtab_thrash test to allow the critical threads to execute.

Depending on certain conditions it was possible for the hashtab counting thread
to starve other threads, preventing them from executing in the expected fashion.
This change adds a sleep to allow the others to do what they need to do. While
this doesn't thrash the hashtab as much as previously, it at least works.

(closes issue ASTERISK-22276)
Reported by: Matt Jordan
........

Merged revisions 396619 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 396620 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/tests/test_hashtab_thrash.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/tests/test_hashtab_thrash.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_hashtab_thrash.c?view=diff&rev=396621&r1=396620&r2=396621
==============================================================================
--- trunk/tests/test_hashtab_thrash.c (original)
+++ trunk/tests/test_hashtab_thrash.c Wed Aug 14 13:10:08 2013
@@ -208,7 +208,7 @@
 
 		if (last_count == count) {
 			/* Allow other threads to run. */
-			sched_yield();
+			usleep(1);
 		} else if (last_count > count) {
 			/* Make sure the hashtable never shrinks */
 			return "hashtab unexpectedly shrank";




More information about the asterisk-commits mailing list