]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Make thread_is_scheduled a static inline
authorDonald Sharp <sharpd@nvidia.com>
Fri, 20 May 2022 13:53:44 +0000 (09:53 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 20 May 2022 13:53:44 +0000 (09:53 -0400)
For performance, yo.

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

index 44183257bbe455842bbea15a4f167b30c7c91f41..fd79503cc6ac5ee3affd430a7f07411938af0309 100644 (file)
@@ -2143,14 +2143,6 @@ 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;
-}
-
 static ssize_t printfrr_thread_dbg(struct fbuf *buf, struct printfrr_eargs *ea,
                                   const struct thread *thread)
 {
index a2049ae52a38e2747af26a6bed487204c045aeaa..acdcec51def29f72b21426c3266865ae1c9cef11 100644 (file)
@@ -283,7 +283,14 @@ 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);
+static inline bool thread_is_scheduled(struct thread *thread)
+{
+       if (thread)
+               return true;
+
+       return false;
+}
+
 /* Debug signal mask */
 void debug_signals(const sigset_t *sigs);