News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Fix for data race in plans_finish_rd

Started by ceeac, April 30, 2020, 05:48:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ceeac

The read access to min_height and max_height at the beginning of karte_t::plans_finish_rd needs to be synchronized since another thread might be writing to any of these two variables.

Dwachs

Imho no mutex is needed. It would be sufficient to initialize those values with -128 and +127. The writing to min//max_height is already protected by some mutex.
Parsley, sage, rosemary, and maggikraut.

ceeac


Dwachs

Parsley, sage, rosemary, and maggikraut.