I make the following reasoning, please tell me what's wrong (or right) about it:
"If inlining a function duplicates the code in the place the function is called, then the static and local variables are duplicated for each function calling it and if there is only one thread running the function that calls the inlined one at the same time, then the code is thread-safe".
"And, if it doesn't help with static and global variables, does it with code that is creating temporary variables?"
Thanks