Skip to content
Snippets Groups Projects
Commit 4dc7a5ca authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dhtrunner: log warning if calling run() while already running

parent 40fdd04c
No related branches found
No related tags found
No related merge requests found
......@@ -104,8 +104,11 @@ DhtRunner::run(const Config& config, Context&& context)
{
std::lock_guard<std::mutex> lck(dht_mtx);
auto expected = State::Idle;
if (not running.compare_exchange_strong(expected, State::Running))
if (not running.compare_exchange_strong(expected, State::Running)) {
if (context.logger)
context.logger->w("[runner %p] Node is already running. Call join() first before calling run() again.");
return;
}
auto local4 = config.bind4;
auto local6 = config.bind6;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment