A lock is a construct that enables the programmer to declare a critical section that can only be accessed by one thread at a time. Before entering the section, the thread attempts to acquire the lock. When exiting, the lock is released.
A lock is a construct that enables the programmer to declare a critical section that can only be accessed by one thread at a time. Before entering the section, the thread attempts to acquire the lock. When exiting, the lock is released.