void function2() { sem.Take(); cout << "This is Second statement, and shall be executed by thread t2 after first statement is executed."<<endl; sem.Give(); }
void function1() { cout << "This is first statement, and shall be executed by thread t1 initially."<<endl; sem.Give(); }