mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 13:55:44 +02:00
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 <bees@furryterror.org>
This commit is contained in:
parent
1aa1decd1d
commit
b7e316b005
@ -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...");
|
||||
|
Loading…
x
Reference in New Issue
Block a user