Files @ r25711:31eedcf7ade0
Branch filter:

Location: cpp/openttd-patchpack/source/src/table/CMakeLists.txt

Patric Stout
Fix: on startup, NewGRF scan could case race-condition (#9382)

Creating a thread was not thread-safe. The irony.

The video-driver has a function GameLoopPause() which first checks
if the thread is the game-thread or not. For this it needs access
to this->game_thread. This variable is set in StartNewThread().

However, due to timing, it is well possible GameLoopPause() is
called from the thread well before this->game_thread is assigned.

And so we have a race-condition!

Simply solve this by preventing a thread to start till we are
done with our bookkeeping.
add_subdirectory(settings)

add_files(
    airport_defaults.h
    airport_movement.h
    airporttile_ids.h
    airporttiles.h
    animcursors.h
    autorail.h
    bridge_land.h
    build_industry.h
    cargo_const.h
    clear_land.h
    control_codes.h
    elrail_data.h
    engines.h
    genland.h
    heightmap_colours.h
    industry_land.h
    landscape_sprite.h
    newgrf_debug_data.h
    object_land.h
    palette_convert.h
    palettes.h
    pricebase.h
    railtypes.h
    road_land.h
    roadtypes.h
    roadveh_movement.h
    sprites.h
    station_land.h
    strgen_tables.h
    string_colours.h
    town_land.h
    townname.h
    track_land.h
    train_cmd.h
    tree_land.h
    unicode.h
    water_land.h
)

add_files(
    opengl_shader.h
    CONDITION OPENGL_FOUND
)