Usually, when I have two concurrent running threads, and each thread calls the same function, there are two instances of the function running in parallel, one in each thread's stack memory. No race condition.
My question is what if I have a global struct with a function pointer.
If I run that function in each thread, from the global struct, is that a race condition? Is there only one copy of the function's variables in the application stack?
Do I need a mutex/semaphore?