In my application, i need to load a file. The loading is actually done by another process, which generates an event on succesful completion of loading. My application will catch this event and process it. I need to suspend the main thread for a while, while waiting for an event and continue further.
i.e.
Code: Select all
MyProcess::test()
{
loadfile(); //The loading is done by another process. On successful loading, an event is generated and intimated to my application.
//here i need to suspend till the event is received. There is another function that handles this event.
My program should continue from this point after processing this event.
....
....
}
Process2::loadfile()
{
load the file
generate event();
}
MyProcess::eventhandler()
{
}
I need to know is there anything like WaitForEvent(event name) which behaves similar to WaitforAccept(), that allows the application to know whether there is any event of the desired type waiting to be processed and allows the control to be switched to the eventhandler() and continue from there
Regards,
Lakshmy