Hi ,
I have two threads, say Thread-1(print 1) and Thread-2(print 2). How I can call them in loop such that they will execute alternatively,
Output--- 1 2 1 2 1 2 .....
Below code give me a output ----- 1 2 2 2 2 2 1 and then release the lock but no
thread available to get the lock .
How we I can modify the code ?
Thanks