[Wayland-bugs] [Bug 91750] Wayland may have interface bug when multi-threads programing.
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Aug 25 19:48:20 PDT 2015
https://bugs.freedesktop.org/show_bug.cgi?id=91750
--- Comment #6 from Jonas Ã…dahl <jadahl at gmail.com> ---
Yujie: as indirectly stated by Pekka, my example was incomplete. You would also
need to dispatch pending events before the wl_display_prepare_read(display)
call. This makes it, ignoring error handling, more or less:
wl_surface_attach();
while (wl_display_prepare_read_queue(display, queue) < 0)
wl_display_dispatch_queue_pending(display, queue);
window->callback = wl_surface_frame(window->surface);
wl_proxy_set_queue(window->callback,queue2);
wl_callback_add_listener(window->callback, &frame_listener, window);
wl_display_cancel_read(display);
wl_surface_commit(window->surface);
This has the side effect that events already in the queue will be always
dispatched before the frame is requested. This may have unwanted effects, so
please consider whether this is Ok in your architecture. If it is not, you need
to make sure that the above code is done after all events on the queue has been
dispatched.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20150826/8c5a9c41/attachment.html>
More information about the wayland-bugs
mailing list