this is related to mutual exclusion in operating systems, when we have a multiprocessor archicture the solution is to combine disabling interruptions and special instructions like test and set , but if we are able to disable interruptions from all processors when a process take over the critical section i think the mutual exclusion will happen.
i tried researching for answers to this question but i didn't find any usefull resources but i think that there is a way for that to happen.