Skip to content
Snippets Groups Projects
  • Esben Haabendal's avatar
    fc90538d
    openharmony-standard: Workaround for race condition in ace engine · fc90538d
    Esben Haabendal authored
    
    When starting up abilities, there is a race condition between OnSurfaceChanged
    and RunPage, which both are executed as PostTask on the same task executor.
    This executor works in FIFO mode, and if (when) the OnSurfaceChanged comes
    first, it will fail with a nullptr check on runningPage_.  This is because the
    runningPage_ variable is set by the RunPage PostTask.
    
    This patch is obviously just a workaround, and not a proper fix.  Hopefully, 500
    ms will be enough in all relevant situations, but at least in theory, the
    problem can still appear.
    
    Signed-off-by: default avatarEsben Haabendal <esben@geanix.com>
    fc90538d
    History
    openharmony-standard: Workaround for race condition in ace engine
    Esben Haabendal authored
    
    When starting up abilities, there is a race condition between OnSurfaceChanged
    and RunPage, which both are executed as PostTask on the same task executor.
    This executor works in FIFO mode, and if (when) the OnSurfaceChanged comes
    first, it will fail with a nullptr check on runningPage_.  This is because the
    runningPage_ variable is set by the RunPage PostTask.
    
    This patch is obviously just a workaround, and not a proper fix.  Hopefully, 500
    ms will be enough in all relevant situations, but at least in theory, the
    problem can still appear.
    
    Signed-off-by: default avatarEsben Haabendal <esben@geanix.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.