i have two cases. in first i have to notify an event after completing certain task
and in 2nd case i have to make the functional statements dependent on event generated in first case(functionality of case 2 dependent on the event generated in case 1)
case 1: int a;
char c;
set_value(1,2);
event_1.notify(); //Want to generate event at this location, how it would be possible in C++
case 2:
wait(event_1); //how to make sensitive to event_1 in C/C++
get_value();
I'm really not sure exactly what you're trying to do since your code doesn't show much, but you could have case 1 set a boolean variable to true that case 2 checks for.
I want that case 2 would be executed only when in last call case 1 is executed
simply want to make case 2 dependable on some event or interrupt being generated after execution of case 1.
case 1:
int a;
char c;
set_value(1,2);
event_1.notify(); //Want to generate event at this location, how it would be possible in C++
break;
case 2:
wait(event_1); //how to make sensitive to event_1 in C/C++
get_value();
break;
Unless you are using threads, they do not need to wait for another event. Instead of creating event, just call whatever you were going to do when that event was recieved. Get it?