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:
parent
5fdc049a79
commit
4841ee4f47
2 changed files with 27 additions and 25 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue