Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
synergy
properly-lock-condvar-add-timeout-condition-to-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File properly-lock-condvar-add-timeout-condition-to-prevent.patch of Package synergy
From 5a74c85e67c939d589f58064c9f094385dc41731 Mon Sep 17 00:00:00 2001 From: Nye Liu <nyet@nyet.org> Date: Thu, 3 Sep 2015 12:09:35 -0700 Subject: [PATCH] Properly lock condVar, add timeout condition to prevent infinite loop when waiting for fillClipboard() to finish --- src/lib/client/Client.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) Index: synergy-1.7.4-stable/src/lib/client/Client.cpp =================================================================== --- synergy-1.7.4-stable.orig/src/lib/client/Client.cpp +++ synergy-1.7.4-stable/src/lib/client/Client.cpp @@ -283,8 +283,16 @@ Client::leave() &Client::sendClipboardThread, NULL)); // Bug #4735 - we can't leave() until fillClipboard()s all finish - while (!m_condData) - m_condVar->wait(); + Stopwatch timer(true); + m_mutex->lock(); + while (!m_condData) { + m_condVar->wait(timer, 0.5); + if (timer.getTime()>0.5) { + LOG((CLOG_DEBUG "timed out waiting for clipboard fill")); + break; + } + } + m_mutex->unlock(); m_screen->leave(); @@ -791,8 +799,10 @@ Client::sendClipboardThread(void * data) } // signal that fill is done + m_mutex->lock(); m_condData = true; m_condVar->signal(); + m_mutex->unlock(); // send clipboards that we own and that have changed for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor