]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Add a thread_is_scheduled function
authorDonald Sharp <sharpd@nvidia.com>
Tue, 12 Oct 2021 17:22:54 +0000 (13:22 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 20 Oct 2021 12:28:52 +0000 (08:28 -0400)
The function thread_is_scheduled allows us to know if
the particular thread is scheduled for execution or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/thread.c
lib/thread.h

index 835aa38115addab24ba83d13fbff433543c7a360..71d7798af51afb0c52185d2008570ad4e8606b16 100644 (file)
@@ -2059,3 +2059,11 @@ void debug_signals(const sigset_t *sigs)
 
        zlog_debug("%s: %s", __func__, buf);
 }
+
+bool thread_is_scheduled(struct thread *thread)
+{
+       if (thread == NULL)
+               return false;
+
+       return true;
+}
index abd94ff4f05910c82a4cc78a7851739068a9cfda..c5f0ffbf773daeded9195195091c4ec3236a7f72 100644 (file)
@@ -273,6 +273,7 @@ extern pthread_key_t thread_current;
 extern char *thread_timer_to_hhmmss(char *buf, int buf_size,
                struct thread *t_timer);
 
+extern bool thread_is_scheduled(struct thread *thread);
 /* Debug signal mask */
 void debug_signals(const sigset_t *sigs);