[Libreoffice-commits] online.git: loolwsd/LOOLStress.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Aug 22 05:31:00 UTC 2016


 loolwsd/LOOLStress.cpp |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit c98af7c5a0436edf9c682e7debad0776d22031b7
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Aug 21 08:21:59 2016 -0400

    loolwsd: Poco HTTPRequest and co are not thread-safe
    
    Change-Id: I5b7a290651a51f117da1dd972f4c24bdebd2b3b2
    Reviewed-on: https://gerrit.libreoffice.org/28300
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLStress.cpp b/loolwsd/LOOLStress.cpp
index 9d331d1..380bb85 100644
--- a/loolwsd/LOOLStress.cpp
+++ b/loolwsd/LOOLStress.cpp
@@ -85,6 +85,8 @@ public:
     {
         Poco::URI uri(serverURI);
 
+        std::unique_lock<std::mutex> lock(Mutex);
+
         // Load a document and get its status.
         std::cerr << "NewSession [" << sessionId << "]: " << uri.toString() << "... ";
         Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_GET, "/lool/ws/" + documentURL);
@@ -111,8 +113,11 @@ private:
     const std::string _documentURL;
     const std::string _sessionId;
     std::shared_ptr<Poco::Net::WebSocket> _ws;
+    static std::mutex Mutex;
 };
 
+std::mutex Connection::Mutex;
+
 /// Main thread class to replay a trace file.
 class Worker: public Runnable
 {


More information about the Libreoffice-commits mailing list