int
__wt_cache_eviction_worker(WT_SESSION_IMPL *session, bool busy, u_int pct_full) {
for (; {
/* See if eviction is still needed. */
if (!__wt_eviction_needed(session, busy, &pct_full) ||
(pct_full pages_evict > init_evict_count + max_pages_evicted))
return (0);
/* Evict a page. */
switch (ret = __evict_page(session, false)) {
case 0:
if (busy)
return (0);
/* FALLTHROUGH */
case EBUSY:
break;
case WT_NOTFOUND:
/* Allow the queue to re-populate before retrying. */
__wt_cond_wait(
session, conn->evict_threads.wait_cond, 10000);
cache->app_waits++;
break;
}