Is it safe to for example do:
void AddTwo(int &num) { num +=2; } void ThreadProc(lpvoid arg) { AddTwo((int)arg); }
Would it be saf
As a general rule of thumb, a function is re-entrant if it doesn't alter any common resources (e.g. same memory locations). If it does, you need to use some sort of synchronization mechanism like mutexes or semaphores.