What is missing above is, why critical sections are called "critical". In a critical section either shared data or the hardware is accessed (since the hardware exists only once, it could be seen as 'shared data' also). Concurrent access to shared data might loose updates or damage the administrative structures (just imagine two threads adding a new frontmost node to a double-linked list at the same time). Concurrent access to hardware may result in intermingled commands,
violation of timing constraints and other nice things
leading to crashes. How to handle critical sections is explained above.