How to: Different functions modifies one data structure

Hi,

i have made different functions and they modifies one data structure.
Unfortunatey the data structure does not remain solid.

How do you work in that case?
What is your solution for keeping data structures solid when several functions edit it.

Thanks in advance.

raidfire.net

I think you need to provide more information if you want a proper answer. What type of data structure? When is it instanciated? Where is it used? Do you have a screenshot?

You may want to add a bool to it that locks it, and set it to locked when one thing starts to modify it, then unlock when it is finished. Only allow modification if it’s not locked. You could use a timer to keep trying to modify until it’s not locked.