Tweak test_hashtab_thrash test to allow the critical threads to execute.
[asterisk/asterisk.git] / tests / test_hashtab_thrash.c
index d547862..619090a 100644 (file)
@@ -68,7 +68,7 @@ static int is_timed_out(struct hash_test const *data) {
        if (val) {
                /* tv_usec is suseconds_t, which could be int or long */
                ast_test_status_update(data->test, "Now: %ld.%06ld Deadline: %ld.%06ld\n",
-                       now.tv_sec, now.tv_usec,
+                       now.tv_sec, (long)now.tv_usec,
                        data->deadline.tv_sec, (long)data->deadline.tv_usec);
        }
        return val;
@@ -208,7 +208,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";