summaryrefslogtreecommitdiff
path: root/src/station_type.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-06-17 20:10:40 +0200
committerGitHub <noreply@github.com>2021-06-17 20:10:40 +0200
commitb45c006ab9bdfb92fa6be66dcfa00099adbb85a8 (patch)
tree0c4641a44cd4447ed598bcef52a0fee8e7238625 /src/station_type.h
parentc12a152ec972309a87ab1637091990520ce9c123 (diff)
downloadopenttd-b45c006ab9bdfb92fa6be66dcfa00099adbb85a8.tar.xz
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.
Diffstat (limited to 'src/station_type.h')
0 files changed, 0 insertions, 0 deletions