Use timevals everywhere where it is possible, including API between main
loop and event dispatchers. This simplifies code and eliminates a bug, when kevent dispatcher is called with 0 timeout. While here, in the main loop call gettimeofday() right after event dispatcher returns. Otherwise, we are using outdated "timeofday" in second part of the loop. I don't know any bugs because of that, but they are possible.
This commit is contained in:
2
event.h
2
event.h
@@ -42,7 +42,7 @@ typedef int event_module_add_t(struct event *);
|
||||
typedef int event_module_del_t(struct event *, int flags);
|
||||
typedef int event_module_init_t(void);
|
||||
typedef void event_module_fini_t(void);
|
||||
typedef int event_module_process_t(u_long);
|
||||
typedef int event_module_process_t(struct timeval *);
|
||||
struct event_module {
|
||||
event_module_add_t *add;
|
||||
event_module_del_t *del;
|
||||
|
||||
Reference in New Issue
Block a user