summaryrefslogtreecommitdiffstats
path: root/net/Socket.cpp
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2018-09-13 09:31:52 +0300
committerTor Lillqvist <tml@collabora.com>2018-09-13 09:33:40 +0300
commit4841ee4f47c3d7d376105830bab6cb1b4108b387 (patch)
tree65f8bfca50ec470f42454ee7ad045fbfd951020a /net/Socket.cpp
parentCreate a method which invalidates and requests all the tiles (diff)
downloadonline-4841ee4f47c3d7d376105830bab6cb1b4108b387.tar.gz
online-4841ee4f47c3d7d376105830bab6cb1b4108b387.zip
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.
Diffstat (limited to 'net/Socket.cpp')
-rw-r--r--net/Socket.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/Socket.cpp b/net/Socket.cpp
index 74a0dff168..5c133b33a5 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -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