What is the primary role of a critical section in concurrent programming?
To create new threads
To ensure that only one thread can execute a piece of code at a time
To assign priorities to threads
To join multiple threads