Original Post
I'm getting a headache working with multiple threads. To achieve thread-safety when using a shared resource between threads, is a function still thread-safe even if it calls other functions that are thread-safe? I imagine a scenario like this (I'm working in C++...): An object has a function Restart() that calls Stop() and Start() in sequence. If both Start() and Stop() are thread-safe, as the their bodies are critical sections, is Restart() also thread-safe? What if another function calls Start() in the middle of Restart()? If Restart() is not thread-safe, how can I achieve it?