[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-7' - loolwsd/MessageQueue.cpp
Jan Holesovsky
kendy at collabora.com
Thu Dec 17 11:22:39 PST 2015
loolwsd/MessageQueue.cpp | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 45eeebeea6cebb359ba2e3041e8a05094ab476d9
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Dec 17 20:19:15 2015 +0100
loolwsd: Extra debugging output about the message queue sizes.
diff --git a/loolwsd/MessageQueue.cpp b/loolwsd/MessageQueue.cpp
index 8e28585..b660aac 100644
--- a/loolwsd/MessageQueue.cpp
+++ b/loolwsd/MessageQueue.cpp
@@ -8,8 +8,10 @@
*/
#include "MessageQueue.hpp"
+#include "Util.hpp"
#include <algorithm>
+#include <iostream>
MessageQueue::~MessageQueue()
{
@@ -20,6 +22,7 @@ void MessageQueue::put(const std::string& value)
{
std::unique_lock<std::mutex> lock(_mutex);
put_impl(value);
+ std::cout << Util::logPrefix() << "message put to the queue, size: " << _queue.size() << std::endl;
lock.unlock();
_cv.notify_one();
}
@@ -27,7 +30,9 @@ void MessageQueue::put(const std::string& value)
std::string MessageQueue::get()
{
std::unique_lock<std::mutex> lock(_mutex);
+ std::cout << Util::logPrefix() << "waiting for non-empty queue, current size: " << _queue.size() << std::endl;
_cv.wait(lock, [this] { return wait_impl(); });
+ std::cout << Util::logPrefix() << "queue became non-empty, current size: " << _queue.size() << std::endl;
return get_impl();
}
More information about the Libreoffice-commits
mailing list