by nevatre » 28 Jul 2010, 18:04
OK, I think I understand what is happening. The relevant functions are GameEnds() and ExitEvent() in backend.c, DisplayFatalError() in xboard.c, and the relevant variable endingGame in backend.c, which is initialised to zero.
The first call to GameEnds() occurs, passing through the first if() and setting endingGame to 1. It gets as far as "sprintf(buf, _("Match %s vs. %s: final score %d-%d-%d"), first.tidy, second.tidy, first.matchWins, second.matchWins, appData.matchGames - (first.matchWins + second.matchWins));", then calls DisplayFatalError(). That function prints the buffer then calls ExitEvent(). That function proceeds to call GameEnds, which returns immediately because endingGame is set to 1. However, ExitEvent() then enters the wait loop as discussed above, because endingGame is set to 1. At this point there is only one GameEnds() running which cannot exit because ExitEvent() is waiting.
One possible solution would be to set endingGame to 2 just before the call to DisplayFatalError() in GemeEnds(), then alter the if condition in ExitEvent() to "if (endingGame==1)".
What do you think H. G. ?