Set thread names in db parallel traversal (#2987)

This commit is contained in:
Wesley Shillingford 2020-09-28 13:03:37 +01:00 committed by GitHub
commit 93c825279b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -85,6 +85,9 @@ std::string nano::thread_role::get_string (nano::thread_role::name role)
case nano::thread_role::name::epoch_upgrader:
thread_role_name_string = "Epoch upgrader";
break;
case nano::thread_role::name::db_parallel_traversal:
thread_role_name_string = "DB par traversl";
break;
}
/*

View file

@ -35,7 +35,8 @@ namespace thread_role
worker,
request_aggregator,
state_block_signature_verification,
epoch_upgrader
epoch_upgrader,
db_parallel_traversal
};
/*
* Get/Set the identifier for the current thread

View file

@ -935,6 +935,7 @@ void parallel_traversal (std::function<void(T const &, T const &, bool const)> c
bool const is_last = thread == thread_count - 1;
threads.emplace_back ([&action, start, end, is_last] {
nano::thread_role::set (nano::thread_role::name::db_parallel_traversal);
action (start, end, is_last);
});
}