how can i run ThreadA and block it and then run ThreadB and block it and again run ThreadA and block it.... upto 5 times
I run two threads A and B simultaniously in my 'thereadmain.cpp' and i run two threads upto 5 times in thread.cpp. now my required output is
A
B
A
B
A
B
A
B
A
B
But Its Prints : Thread A
and Finished ,
Finished.
is it possible to print my required output through semaphores..
i want to reun the above program without using sleep().
Bookmarks