From 4f11241f70d9a4244ec77c390d7c1635746d5ef0 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Wed, 14 Aug 2013 18:07:37 +0000 Subject: [PATCH] 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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396619 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- tests/test_hashtab_thrash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_hashtab_thrash.c b/tests/test_hashtab_thrash.c index 373922bf84..2c135956e0 100644 --- a/tests/test_hashtab_thrash.c +++ b/tests/test_hashtab_thrash.c @@ -198,7 +198,7 @@ static void *hash_test_count(void *d) 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"; -- 2.47.3