From: Marco Schlumpp Date: Thu, 9 Feb 2023 14:57:30 +0000 (+0100) Subject: lib/uksched: Expose uk_thread_block_until X-Git-Tag: RELEASE-0.13.0~71 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7683671942d29fb5c3cc4c6471f257f0dc290687;p=unikraft%2Funikraft.git lib/uksched: Expose uk_thread_block_until This allows external API clients to specify an absolute deadline for waking up. This is potentially more precise because the `timeout` is relative to whenever uk_thread_block_timeout is actually taking the "current" time. Signed-off-by: Marco Schlumpp Reviewed-by: Adina Smeu Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #758 --- diff --git a/lib/uksched/exportsyms.uk b/lib/uksched/exportsyms.uk index 5a756bbb0..d798aacd4 100644 --- a/lib/uksched/exportsyms.uk +++ b/lib/uksched/exportsyms.uk @@ -31,6 +31,7 @@ uk_thread_create_fn1 uk_thread_create_fn2 uk_thread_set_exited uk_thread_release +uk_thread_block_until uk_thread_block_timeout uk_thread_block uk_thread_wake diff --git a/lib/uksched/include/uk/thread.h b/lib/uksched/include/uk/thread.h index b73b2a483..4680cb5a9 100644 --- a/lib/uksched/include/uk/thread.h +++ b/lib/uksched/include/uk/thread.h @@ -594,6 +594,7 @@ struct uk_thread *uk_thread_create_fn2(struct uk_alloc *a, uk_thread_dtor_t dtor); void uk_thread_release(struct uk_thread *t); +void uk_thread_block_until(struct uk_thread *thread, __snsec until); void uk_thread_block_timeout(struct uk_thread *thread, __nsec nsec); void uk_thread_block(struct uk_thread *thread); void uk_thread_wake(struct uk_thread *thread); diff --git a/lib/uksched/thread.c b/lib/uksched/thread.c index 0a16509fc..f06b675c8 100644 --- a/lib/uksched/thread.c +++ b/lib/uksched/thread.c @@ -923,7 +923,7 @@ void uk_thread_release(struct uk_thread *t) uk_free(a, t); } -static void uk_thread_block_until(struct uk_thread *thread, __snsec until) +void uk_thread_block_until(struct uk_thread *thread, __snsec until) { unsigned long flags;