summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-04-05 11:35:59 +0200
committerJan Holesovsky <kendy@collabora.com>2017-04-05 11:36:23 +0200
commit3ca488320eacbc4810658ddfdad0d356fd904be8 (patch)
treeee55d7e5db37e12a71ba6c6e3975b4f11a3d1707
parent52f5f3070431484a9a3bd42b66b6ea05a9d5562d (diff)
The other isCorrectThread() should be active only in the debug build too.2.1-beta2
Change-Id: Ieadb7e14f70752f5cfb2fd9ee569b56fb39d528b
-rw-r--r--net/Socket.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 9e06a0408..710001176 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -294,12 +294,16 @@ public:
/// Are we running in either shutdown, or the polling thread.
bool isCorrectThread() const
{
+#if ENABLE_DEBUG
if (std::this_thread::get_id() != _owner)
LOG_WRN("Incorrect thread affinity for " << _name << ". Expected: 0x" << std::hex <<
_owner << " (" << std::dec << Util::getThreadId() << ") but called from 0x" <<
std::hex << std::this_thread::get_id() << std::dec << ", stop: " << _stop);
return _stop || std::this_thread::get_id() == _owner;
+#else
+ return true;
+#endif
}
/// Poll the sockets for available data to read or buffer to write.