From 42cdc61a93cf2acb09936aebb5e431fdbc0a26c6 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 27 May 2021 20:02:53 -0300 Subject: [PATCH] Client: Always destroy frame callback in the actual callback It's good hygiene to destroy all frame callbacks. Destroy the frame callback and cleanup the mFrameCallback class member in the callback itself. The callback destruction happens before calling handleFrameCallback() to avoid the theoretical case where another frame callback is queued by handleFrameCallback(), and then immediately destroyed in the callback handler. Change-Id: Ide6dc95e3402932c58bfc088a9d471fda821e9a1 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/client/qwaylandwindow.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index d83d51695..5561f58f7 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -659,9 +659,13 @@ void QWaylandWindow::commit() const wl_callback_listener QWaylandWindow::callbackListener = { [](void *data, wl_callback *callback, uint32_t time) { - Q_UNUSED(callback); Q_UNUSED(time); auto *window = static_cast(data); + + Q_ASSERT(callback == window->mFrameCallback); + wl_callback_destroy(callback); + window->mFrameCallback = nullptr; + window->handleFrameCallback(); } }; @@ -1366,11 +1370,6 @@ void QWaylandWindow::handleUpdate() if (!mSurface) return; - if (mFrameCallback) { - wl_callback_destroy(mFrameCallback); - mFrameCallback = nullptr; - } - QMutexLocker locker(mFrameQueue.mutex); struct ::wl_surface *wrappedSurface = reinterpret_cast(wl_proxy_create_wrapper(mSurface->object())); wl_proxy_set_queue(reinterpret_cast(wrappedSurface), mFrameQueue.queue); -- 2.38.1 uix/log/?id=fa2404ff1ffcf4f522c7400f3b10dad17f157378'>root/build-aux/cuirass
AgeCommit message (Expand)Author
2022-05-26cuirass: Create just as many threads as needed....* build-aux/cuirass/evaluate.scm (command-line): Change second argument to 'n-par-for-each'. Ludovic Courtès
2022-05-26cuirass: Fork inferior processes before creating threads....Works around <https://issues.guix.gnu.org/55441#12>. Start from commit bd86bbd300474204878e927f6cd3f0defa1662a5, 'open-inferior' uses 'primitive-fork' instead of 'open-pipe*'. As a result, child process could potentially hang before calling 'execl' due to undefined behavior when forking a multi-threaded process. * build-aux/cuirass/evaluate.scm <top level>: Call 'open-inferior' before 'n-par-for-each'. Ludovic Courtès
2022-05-20cuirass: Close each inferior upon completion....* build-aux/cuirass/evaluate.scm <top level>: Add 'close-inferior' call. Ludovic Courtès
2021-03-10ci: Remove hydra support....This removes hydra support to use Cuirass as the only continuous integration system. * build-aux/hydra/gnu-system.scm: Remove it. * build-aux/hydra/guix-modular.scm: Ditto. * build-aux/hydra/guix.scm: Ditto. * build-aux/cuirass/hydra-to-cuirass.scm: Ditto. * Makefile.am (EXTRA_DIST): Update it. (hydra-jobs.scm): Remove it. (cuirass-jobs.scm): Update it. * build-aux/hydra/evaluate.scm: Move it to ... * build-aux/cuirass/evaluate.scm: ... here. * build-aux/cuirass/guix-modular.scm: Remove it. * build-aux/cuirass/gnu-system.scm: Ditto. * guix/packages.scm (%hydra-supported-systems): Rename it to ... (%cuirass-supported-systems): ... this variable. * build-aux/check-final-inputs-self-contained: Adapt it. * etc/release-manifest.scm: Ditto. * gnu/ci.scm (package->alist): Remove it. (derivation->job): New procedure. (package-job, package-cross-job, cross-jobs, image-jobs, system-test-jobs, tarball-jobs): Use it. (guix-jobs): New procedure. (hydra-jobs): Rename it to ... (cuirass-jobs): ... this procedure. Mathieu Othacehe
2020-10-04cuirass: Add hurd-manifest....* build-aux/cuirass/hurd-manifest.scm: New file. Jan (janneke) Nieuwenhuizen