From b7e316b0057b11ea0d1c2a13dbf615d5ca661aaa Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 1 Oct 2017 16:19:21 -0400 Subject: [PATCH] roots: clean out dead code around crawl locks Remove a number of #if 0's. Remove the redundant thread yield after implementing the same or better in LockSet. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index be0ba92..1b1a3b6 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -576,29 +576,18 @@ void BeesCrawl::crawl_thread() { Timer crawl_timer; - auto crawl_lock = m_ctx->roots()->lock_set().make_lock(m_state.m_root, false); while (!m_stopped) { -#if 0 - BEESNOTE("waiting for crawl thread limit " << m_state); - crawl_lock.lock(); -#endif BEESNOTE("pop_front " << m_state); auto this_range = pop_front(); -#if 0 - crawl_lock.unlock(); -#endif if (this_range) { catch_all([&]() { -#if 1 BEESNOTE("waiting for scan thread limit " << m_state); - crawl_lock.lock(); -#endif + auto crawl_lock = m_ctx->roots()->lock_set().make_lock(m_state.m_root); + BEESNOTE("scan_forward " << this_range); m_ctx->scan_forward(this_range); }); BEESCOUNT(crawl_scan); - // Let another thread have a turn with the mutexes - this_thread::yield(); } else { auto crawl_time = crawl_timer.age(); BEESLOGNOTE("Crawl ran out of data after " << crawl_time << "s, waiting for more...");