Skip to content
  • Alexandros Frantzis's avatar
    libweston: Introduce a safer wayland signal emission · 8b6daa41
    Alexandros Frantzis authored and Daniel Stone's avatar Daniel Stone committed
    
    
    Wayland signals (wl_signal) do not reliably handle changes to the
    notification list during signal emission. Such scenarios occasionally
    come up and can be difficult to investigate and debug.
    
    This commit introduces the weston_signal_emit_mutable() function which can be
    used in place of wl_signal_emit() and safely implements the following
    behavior regarding notification list changes:
    
    1. Listeners deleted during a signal emission and which have not already been
       notified at the time of deletion are not notified by that emission.
    
    2. Listeners added during signal emission are ignored by that emission.
    
    The implementation of weston_signal_emit_mutable() is copied from the
    wlr_signal_emit_safe() function of the wlroots project.
    
    Signed-off-by: default avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
    8b6daa41
Loading