int x = 0; // globalLock L1; // globalmain() {create a thread to execute foo(); // Thread T1create a thread to execute foo(); // Thread T2wait for the two threads to finish execution;print (x);}foo() {int y = 0;Acquire L1;x = x + 1;y = y + 1;Release L1;print (y); }