diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:32 +0000 |
commit | 35cadacd2bb9383686753731e31bd7e145fb2506 (patch) | |
tree | 4489adbde75a837989533837185b2b8369a0bf68 /lib/frrevent.h | |
parent | Adding debian version 9.1-0.1. (diff) | |
download | frr-35cadacd2bb9383686753731e31bd7e145fb2506.tar.xz frr-35cadacd2bb9383686753731e31bd7e145fb2506.zip |
Merging upstream version 10.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/frrevent.h')
-rw-r--r-- | lib/frrevent.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/frrevent.h b/lib/frrevent.h index 3f74df3..94640a7 100644 --- a/lib/frrevent.h +++ b/lib/frrevent.h @@ -6,6 +6,7 @@ #ifndef _ZEBRA_THREAD_H #define _ZEBRA_THREAD_H +#include <signal.h> #include <zebra.h> #include <pthread.h> #include <poll.h> @@ -91,6 +92,8 @@ struct event_loop { pthread_mutex_t mtx; pthread_t owner; + nfds_t last_read; + bool ready_run_loop; RUSAGE_T last_getrusage; }; @@ -153,6 +156,12 @@ struct cpu_event_history { /* Struct timeval's tv_usec one second value. */ #define TIMER_SECOND_MICRO 1000000L +static inline unsigned long timeval_elapsed(struct timeval a, struct timeval b) +{ + return (((a.tv_sec - b.tv_sec) * TIMER_SECOND_MICRO) + + (a.tv_usec - b.tv_usec)); +} + /* Event yield time. */ #define EVENT_YIELD_TIME_SLOT 10 * 1000L /* 10ms */ |