Event generation and sensitivity

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();
You will want a break; after each case. What exactly are you trying to do? Run case 2 after case 1?
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;
They can't be bothe executed at the same time. If you want case 2 to be executed after case 1, just call a function with the code of case 2.
i want to make functionality like that

functionality_1
event_1

wait(event_1)
functionality_2
event_2

wait(event_2)
functionality_2
event_2
:
:

So i am asking is there something like event in C or some alternative
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?
Topic archived. No new replies allowed.