summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-04-10 14:54:17 +0200
committerJan Holesovsky <kendy@collabora.com>2017-04-10 14:56:46 +0200
commit2a60fff6979aa76662b42b0116a5b85f2d500a87 (patch)
tree18e082201726003f57a58031443a19fe9cabab09
parent8db2911cd45a059262814f78b286d9419eab2045 (diff)
Set the _owner even in the release builds.
We are warning about thread affinity even in the non-debug builds. Change-Id: Ia91170765e9f4a29939dee847899345e9396d2c3
-rw-r--r--net/Socket.hpp7
-rw-r--r--wsd/AdminModel.hpp2
2 files changed, 4 insertions, 5 deletions
diff --git a/net/Socket.hpp b/net/Socket.hpp
index e8e922774..74caa5aa7 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -221,11 +221,11 @@ protected:
{
setNoDelay();
_sendBufferSize = DefaultSendBufferSize;
-#if ENABLE_DEBUG
_owner = std::this_thread::get_id();
LOG_DBG("#" << _fd << " Thread affinity set to 0x" << std::hex <<
_owner << "." << std::dec);
+#if ENABLE_DEBUG
const int oldSize = getSocketBufferSize();
setSocketBufferSize(0);
LOG_TRC("#" << _fd << ": Buffer size: " << getSendBufferSize() <<
@@ -236,7 +236,8 @@ protected:
private:
const int _fd;
int _sendBufferSize;
- // always enabled to avoid ABI change in debug mode ...
+
+ /// We check the owner even in the release builds, needs to be always correct.
std::thread::id _owner;
};
@@ -531,11 +532,9 @@ private:
Util::setThreadName(_name);
LOG_INF("Starting polling thread [" << _name << "].");
-#if ENABLE_DEBUG
_owner = std::this_thread::get_id();
LOG_DBG("Thread affinity of " << _name << " set to 0x" <<
std::hex << _owner << "." << std::dec);
-#endif
// Invoke the virtual implementation.
pollingThread();
diff --git a/wsd/AdminModel.hpp b/wsd/AdminModel.hpp
index 9a7ee8c9b..80f0437b0 100644
--- a/wsd/AdminModel.hpp
+++ b/wsd/AdminModel.hpp
@@ -208,7 +208,7 @@ private:
std::list<unsigned> _cpuStats;
unsigned _cpuStatsSize = 100;
- // always enabled to avoid ABI change in debug mode ...
+ /// We check the owner even in the release builds, needs to be always correct.
std::thread::id _owner;
};