From d5dca21a958001a555b9a313156567f0bdec643b Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Thu, 15 Jul 2021 11:48:48 -0600 Subject: lib/thread: Add thread_yield helper method This helper method is just a shorthand for `thread_yield_microseconds(0)`. I think it makes it clear that we want to yield a thread without delaying. BUG=b:179699789 TEST=build test Suggested-by: Julius Werner Signed-off-by: Raul E Rangel Change-Id: Id8b60c35b183cff6871d7ba70b36eb33b136c735 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56349 Reviewed-by: Karthik Ramasubramanian Reviewed-by: Furquan Shaikh Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- src/lib/thread.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib') diff --git a/src/lib/thread.c b/src/lib/thread.c index 782a63ea52..a8c0772c89 100644 --- a/src/lib/thread.c +++ b/src/lib/thread.c @@ -332,6 +332,11 @@ int thread_run_until(void (*func)(void *), void *arg, return 0; } +int thread_yield(void) +{ + return thread_yield_microseconds(0); +} + int thread_yield_microseconds(unsigned int microsecs) { struct thread *current; -- cgit v1.2.3