Lock Variable

Entry Section
While (lock! = 0);
Critical Section
Lock = 1;
Exit Section
Lock =0;

Entry Section
Test Lock
Set Lock
Crititcal section
Exit Section
Lock Value =

Process in Waiting Queue