What is a race condition and how do you avoid it?

Technical