[Libreoffice-commits] online.git: net/Socket.hpp net/WebSocketHandler.hpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Apr 3 05:19:15 UTC 2017
net/Socket.hpp | 16 ++++++----------
net/WebSocketHandler.hpp | 2 +-
2 files changed, 7 insertions(+), 11 deletions(-)
New commits:
commit 8932a1e92e9dbe61841a92d970751ecc41f32a80
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Mon Apr 3 01:02:35 2017 -0400
wsd: remove LOOL_CHECK_THREADS
isCorrectThread now always checks
with ENABLE_DEBUG.
Change-Id: I2b5747f3ab18c8ebdbc92e7ffc86a2469b8c7d13
Reviewed-on: https://gerrit.libreoffice.org/36038
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 7d227732..9cf83c49 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -195,7 +195,7 @@ public:
#endif
}
- virtual bool isCorrectThread(bool hard = false)
+ virtual bool isCorrectThread()
{
#if ENABLE_DEBUG
const bool sameThread = std::this_thread::get_id() == _owner;
@@ -204,12 +204,8 @@ public:
_owner << " but called from 0x" << std::this_thread::get_id() << " (" <<
std::dec << Util::getThreadId() << ").");
- if (hard)
- return sameThread;
- else
- return !getenv("LOOL_CHECK_THREADS") || sameThread;
+ return sameThread;
#else
- (void)hard;
return true;
#endif
}
@@ -455,7 +451,7 @@ public:
{
assert(socket);
assert(isCorrectThread());
- assert(socket->isCorrectThread(true));
+ assert(socket->isCorrectThread());
auto it = std::find(_pollSockets.begin(), _pollSockets.end(), socket);
assert(it != _pollSockets.end());
@@ -650,7 +646,7 @@ public:
/// Send data to the socket peer.
void send(const char* data, const int len, const bool flush = true)
{
- assert(isCorrectThread(true));
+ assert(isCorrectThread());
if (data != nullptr && len > 0)
{
_outBuffer.insert(_outBuffer.end(), data, data + len);
@@ -732,7 +728,7 @@ protected:
HandleResult handlePoll(std::chrono::steady_clock::time_point now,
const int events) override
{
- assert(isCorrectThread(true));
+ assert(isCorrectThread());
_socketHandler->checkTimeout(now);
@@ -800,7 +796,7 @@ protected:
/// Override to write data out to socket.
virtual void writeOutgoingData()
{
- assert(isCorrectThread(true));
+ assert(isCorrectThread());
assert(!_outBuffer.empty());
do
{
diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 0cf63a36..8d689de3 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -330,7 +330,7 @@ protected:
if (!socket || data == nullptr || len == 0)
return -1;
- assert(socket->isCorrectThread(true));
+ assert(socket->isCorrectThread());
std::vector<char>& out = socket->_outBuffer;
out.push_back(flags);
More information about the Libreoffice-commits
mailing list