Skip to content

Commit

Permalink
Ensure a single thread will be used to accept connections
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-webb committed May 8, 2024
1 parent cf946bc commit 59e8348
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/cpp/telnetappender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ void TelnetAppender::activateOptions(Pool& /* p */)
_priv->serverSocket->setSoTimeout(1000);
}

_priv->sh = ThreadUtility::instance()->createThread( LOG4CXX_STR("TelnetAppender"), &TelnetAppender::acceptConnections, this );
if (!_priv->sh.joinable())
_priv->sh = ThreadUtility::instance()->createThread( LOG4CXX_STR("TelnetAppender"), &TelnetAppender::acceptConnections, this );
}

void TelnetAppender::setOption(const LogString& option,
Expand Down

0 comments on commit 59e8348

Please sign in to comment.