mirror of
https://github.com/debauchee/barrier.git
synced 2026-06-14 22:26:20 +08:00
Add retry to CondVarBase wait(), make sure Stopwatch is started on construction (Issue #4735)
* ArchMultithreadPosix::waitCondVar() returns every 100ms, so retry until we hit timeout. * Stopwatch constructor should be called with "false" (not "true") to make sure Stopwatch is actually running when instantiated.
This commit is contained in:
@@ -513,6 +513,7 @@ XWindowsClipboard::icccmFillCache()
|
||||
LOG((CLOG_DEBUG1 "selection doesn't support TARGETS"));
|
||||
data = "";
|
||||
XWindowsUtil::appendAtomData(data, XA_STRING);
|
||||
// return; // NTL
|
||||
}
|
||||
|
||||
XWindowsUtil::convertAtomProperty(data);
|
||||
@@ -1317,7 +1318,7 @@ XWindowsClipboard::CICCCMGetClipboard::readClipboard(Display* display,
|
||||
// by badly behaved selection owners.
|
||||
XEvent xevent;
|
||||
std::vector<XEvent> events;
|
||||
Stopwatch timeout(true);
|
||||
Stopwatch timeout(false); // timer not stopped, not triggered
|
||||
static const double s_timeout = 0.25; // FIXME -- is this too short?
|
||||
bool noWait = false;
|
||||
while (!m_done && !m_failed) {
|
||||
@@ -1361,7 +1362,7 @@ XWindowsClipboard::CICCCMGetClipboard::readClipboard(Display* display,
|
||||
XSelectInput(display, m_requestor, attr.your_event_mask);
|
||||
|
||||
// return success or failure
|
||||
LOG((CLOG_DEBUG1 "request %s", m_failed ? "failed" : "succeeded"));
|
||||
LOG((CLOG_DEBUG1 "request %s after %fs", m_failed ? "failed" : "succeeded", timeout.getTime()));
|
||||
return !m_failed;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user