From stackoverflow I get to know that if I define a struct event variable in a function which is different from where event_base_dispatch()
is defined, this event will not be added to the event loop, as below, ev1 will not be added to event loop.
void func(){
struct event ev1;
event_set(&ev1, ...);
event_add(&ev1, ...)
}
int main(){
func();
event_base_dispatch(base);
}
That's being said I need to create
many events that are local varibles which are not seen by event_base_dispatch(base);
are there any workaround for my problem?