Move SocketPoll::pollingThreadEntry() implementation to cpp file

Makes it easier to put a breakpoint in it in Xcode...

Not sure if we have any consistent convention around here anyway about
which member functions should be defined inline in the class
definition in the hpp file, and which ones should be in the cpp file.
This commit is contained in:
Tor Lillqvist 2018-09-13 09:31:52 +03:00 committed by Tor Lillqvist
parent 5fdc049a79
commit 4841ee4f47
2 changed files with 27 additions and 25 deletions

View file

@ -153,6 +153,32 @@ void SocketPoll::feed(const std::string& payload)
#endif
void SocketPoll::pollingThreadEntry()
{
try
{
Util::setThreadName(_name);
LOG_INF("Starting polling thread [" << _name << "].");
_owner = std::this_thread::get_id();
LOG_DBG("Thread affinity of " << _name << " set to " <<
Log::to_string(_owner) << ".");
// Invoke the virtual implementation.
pollingThread();
// Release sockets.
_pollSockets.clear();
_newSockets.clear();
}
catch (const std::exception& exc)
{
LOG_ERR("Exception in polling thread [" << _name << "]: " << exc.what());
}
_threadFinished = true;
}
void SocketPoll::wakeupWorld()
{
#ifndef MOBILEAPP

View file

@ -675,31 +675,7 @@ private:
/// The polling thread entry.
/// Used to set the thread name and mark the thread as stopped when done.
void pollingThreadEntry()
{
try
{
Util::setThreadName(_name);
LOG_INF("Starting polling thread [" << _name << "].");
_owner = std::this_thread::get_id();
LOG_DBG("Thread affinity of " << _name << " set to " <<
Log::to_string(_owner) << ".");
// Invoke the virtual implementation.
pollingThread();
// Release sockets.
_pollSockets.clear();
_newSockets.clear();
}
catch (const std::exception& exc)
{
LOG_ERR("Exception in polling thread [" << _name << "]: " << exc.what());
}
_threadFinished = true;
}
void pollingThreadEntry();
private:
/// Debug name used for logging.