I am confused. As I understand, a piece of code is thread-safe if it functions correctly during simultaneous execution by multiple threads. And data race occurs when 2 instructions from different threads access the same memory location, at least one of these accesses is a write and there is no synchronization that is mandating any particular order among these accesses.
Its clear that both relate to concurrency. But are they addressing the same thing?