[Libreoffice-commits] online.git: net/Socket.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Mar 13 04:25:22 UTC 2017


 net/Socket.cpp |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit c4d27fd060d93c61e9f475c63c34c828e84a55d6
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Mar 12 22:29:58 2017 -0400

    wsd: prevent and warn when joining own thread
    
    Change-Id: I8405a1aacb1281e52bbd07d32cdcf35bdc484d8b
    Reviewed-on: https://gerrit.libreoffice.org/35124
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/net/Socket.cpp b/net/Socket.cpp
index de41e34..96734d0 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -56,7 +56,12 @@ SocketPoll::~SocketPoll()
 {
     stop();
     if (_threadStarted && _thread.joinable())
-        _thread.join();
+    {
+        if (_thread.get_id() == std::this_thread::get_id())
+            LOG_ERR("DEADLOCK PREVENTED: joining own thread!");
+        else
+            _thread.join();
+    }
 
     ::close(_wakeup[0]);
     ::close(_wakeup[1]);


More information about the Libreoffice-commits mailing list