summaryrefslogtreecommitdiff
path: root/lib/thread.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-01-19 14:56:25 -0500
committerDonald Sharp <sharpd@nvidia.com>2022-01-20 11:58:48 -0500
commite8b3a2f74b707529c70908c6afc97a486588ef30 (patch)
tree33d0f5d910db7949be2c6d911e7a17cb225fafc6 /lib/thread.h
parentab01a00176db60080047731ab548136e773b6c51 (diff)
lib, zebra: Add ability to tell thread system to ignore late timers
Add a thread_ignore_late_timer(struct thread *thread) function that allows thread.c to ignore when timers are late to the party. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/thread.h')
-rw-r--r--lib/thread.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/thread.h b/lib/thread.h
index 49a70696d0..660f8bd28e 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -126,6 +126,7 @@ struct thread {
unsigned long yield; /* yield time in microseconds */
const struct xref_threadsched *xref; /* origin location */
pthread_mutex_t mtx; /* mutex for thread.c functions */
+ bool ignore_timer_late;
};
#ifdef _FRR_ATTRIBUTE_PRINTFRR
@@ -285,6 +286,11 @@ extern bool thread_is_scheduled(struct thread *thread);
/* Debug signal mask */
void debug_signals(const sigset_t *sigs);
+static inline void thread_ignore_late_timer(struct thread *thread)
+{
+ thread->ignore_timer_late = true;
+}
+
#ifdef __cplusplus
}
#endif