I register an timeout event as below:

struct event * fin_ev = (struct event *)malloc(sizeof(struct event));
event_set(fin_ev, -1, 0, on_fin_timeout, NULL);
event_base_set(base, fin_ev);
event_add(fin_ev, &tv) ;

and when a condition is satisfied when the timeout event is not triggered,
I want to remove the event and add it again

can I do something like:

       if(condition){
           event_del(fin_ev);
           event_add(fin_ev, &tv)
      }

or

       if(condition){
          event_set(fin_ev, -1, 0, on_fin_timeout, NULL);
          event_base_set(base, fin_ev);
           event_del(fin_ev);
           event_add(fin_ev, &tv)
      }

?

Reply via email to