]> git.mxchange.org Git - flightgear.git/commit
A long, long time ago, a bug was inadvertently introduced into the threaded
authorcurt <curt>
Tue, 22 Nov 2005 17:02:31 +0000 (17:02 +0000)
committercurt <curt>
Tue, 22 Nov 2005 17:02:31 +0000 (17:02 +0000)
commite807c7f95c4e68466172416a84e672eaa37d1cf6
tree056b6120231ecf8bcf6bedbf0e1900fb660eb1fc
parent4443267e4e3349e0ed299d347b26a370c1c258bc
A long, long time ago, a bug was inadvertently introduced into the threaded
metar fetcher.  Effectively this caused the metar thread and the main
thread to both attempt to fetch weather data.  This could lead to long pauses
when the main thread decided to fetch the weather, and introduced a race
condition that could cause a segfault/crash.

Investigating this issue, I discovered that even longer ago, someone confused
#defines and #ifdef symbols with C/C++ variables.  If I #define XYZ 0 it is
defined so #ifdef XYZ is true, not false like a variable.  Our thread
detection made this mistake and there were follow up patches to work around
it.

So I fixed the configure script (ahhh, reading the autoconf manual is highly
recommended excercise for people editing the configure.ac file.)  I also
discovered that we were hardwiring with_threads=yes with no way via configure
options to disable threads from the build so I fixed that.

Then I patched up the #ifdef's scattered through the code to match the
configure script changes, oh and by the way, I stumbled upon a past typo
that led to the race condition in the metar fetching thread and fixed that.
src/Environment/environment_ctrl.cxx
src/Environment/environment_ctrl.hxx
src/Scenery/FGTileLoader.cxx
src/Scenery/FGTileLoader.hxx
src/Scenery/tilemgr.cxx
src/Scenery/tilemgr.hxx