What is "thread-safety"

A piece of code is thread-safe if it only handles data structures in a way that allows consistent execution of this code across multiple execution segments (threads). A code can be thread-safe, conditionally secure (mutual exclusion required) or not (it can only be used securely by a thread).

Key thread-safe approaches include reentry, local segment storage, mutual exclusion (blocking), atomic operations, and immutable objects.

Wikipedia