ref: ec1fed3fe2fcc41562b5daf318ca4dce201f1c2a
parent: 8391a9e364622cb7d85e128b427fb96c75e18265
author: Jacob Moody <moody@posixcafe.org>
date: Sat Jun 29 14:19:32 EDT 2024
gui-wl: take lock when flushing from framedone callback The wayland callbacks are generally done in another thread, so it was possible to be servicing a flush from the /dev/draw side while also getting a callback.
--- a/gui-wl/wl-cb.c
+++ b/gui-wl/wl-cb.c
@@ -80,7 +80,9 @@
wl_callback_destroy(cb);
cb = wl_surface_frame(wl->surface);
wl_callback_add_listener(cb, &wl_surface_frame_listener, wl);
+ qlock(&drawlock);
wlflush(wl);
+ qunlock(&drawlock);
}
static void