I am writing a program using threads in C in linux environment.
The main program creates a thread "mythread" and calls it. . the mythread should wait for event to occur and sleep till then, giving the control back to the main. and when the even occurs mythread should wake and do some work and again sleep ,give the control back to main .
please provide with code.
thanks in advance.