OS-level yield is generally a bad and possibly dangerous idea. If the
thread should be suspended, there should always be something to wait on,
or it turns into busy waiting. And if it's "just giving something else
the chance to run" - that's the kernel's job to determine, and the
kernel will do so while considering priorities, cgroups, and whatnot.
Let it do its job.
Signed-off-by: David Lamparter <equinox@diac24.net>
pthread_mutex_unlock(&frr_pthread_list_mtx);
}
-void frr_pthread_yield(void)
-{
- (void)sched_yield();
-}
-
/*
* ----------------------------------------------------------------------------
* Default Event Loop
/* Stops all frr_pthread's. */
void frr_pthread_stop_all(void);
-/* Yields the current thread of execution */
-void frr_pthread_yield(void);
-
#ifndef HAVE_PTHREAD_CONDATTR_SETCLOCK
#define pthread_condattr_setclock(A, B)
#endif