Good day, every process in my software is about to update 3 specific globals in row when the process is called to do some job. I need to guarantee that during updating of those globals with multiple processes there is only one process that is actually working with those globals. Moreover I need my globals unreadable if other process is in critical area.
Example:

(for example globals: ^data1, ^data2, ^data3 are critical area)
Should I use somehow function $LOCK() or there is another way how this can be done?



