The OS and the IPC (interprocess call) scheme handles all of that. Race conditions, data contention, etc. are all completely impossible by design. If I tried to do "something funny" it simply would not compile.
Now I'm really curious, that sounds like a SIL/ASIL x device or similar, are you allowed to share any more details on it? PM is fine, there's so little published about real-world use of these things that I'm always interested in examples.