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

New commits:
commit c4d27fd060d93c61e9f475c63c34c828e84a55d6
Author: Ashod Nakashian <ashod.nakash...@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 <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@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]);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to