• Show log

    Commit

  • Hash : 25f9e32b
    Author : David Gow
    Date : 2021-10-02T16:52:43

    wayland: Don't let multiple threads dispatch wayland events at once
    
    wl_display_dispatch() will block if there are no events available, and
    while we try to avoid this by using SDL_IOReady() to verify there are
    events before calling it, there is a race condition between
    SDL_IOReady() and wl_display_dispatch() if multiple threads are
    involved.
    
    This is made more likely by the fact that SDL_GL_SwapWindow() calls
    wl_display_dispatch() if vsync is enabled, in order to wait for frame
    events. Therefore any program which pumps events on a different thread
    from SDL_GL_SwapWindow() could end up blocking in one or other of them
    until another event arrives.
    
    This change fixes this by wrapping wl_display_dispatch() in a new mutex,
    which ensures only one thread can compete for wayland events at a time,
    and hence the SDL_IOReady() check should successfully prevent either
    from blocking.
    

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/SDL.git
    Git SSH git@git.kmx.io:kc3-lang/SDL.git
    Public access ? public
    Description

    Fork of https://github.com/libsdl-org/SDL

    Users
    thodg_w kc3_lang_org thodg_l thodg_m www_kmx_io thodg
    Tags