Skip to content
Snippets Groups Projects
Commit 0d039869 authored by Joshua Colp's avatar Joshua Colp
Browse files

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@396620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent f83b1448
No related merge requests found
...@@ -198,7 +198,7 @@ static void *hash_test_count(void *d) ...@@ -198,7 +198,7 @@ static void *hash_test_count(void *d)
if (last_count == count) { if (last_count == count) {
/* Allow other threads to run. */ /* Allow other threads to run. */
sched_yield(); usleep(1);
} else if (last_count > count) { } else if (last_count > count) {
/* Make sure the hashtable never shrinks */ /* Make sure the hashtable never shrinks */
return "hashtab unexpectedly shrank"; return "hashtab unexpectedly shrank";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment