]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/uksched: Expose uk_thread_block_until
authorMarco Schlumpp <marco@unikraft.io>
Thu, 9 Feb 2023 14:57:30 +0000 (15:57 +0100)
committerUnikraft <monkey@unikraft.io>
Sun, 7 May 2023 12:18:32 +0000 (12:18 +0000)
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 <marco@unikraft.io>
Reviewed-by: Adina Smeu <adina.smeu@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #758

lib/uksched/exportsyms.uk
lib/uksched/include/uk/thread.h
lib/uksched/thread.c

index 5a756bbb0dfd4f33aca7274fbd44fd63eb8a4311..d798aacd4f8e4a32845a2ac35f5d4b71b182af33 100644 (file)
@@ -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
index b73b2a4838e0141124404b900813a0a5d8fbb97e..4680cb5a9ac272eb4f8079a0d42c65b1de8b4111 100644 (file)
@@ -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);
index 0a16509fc455e5e2139515b8afcb8207863cecae..f06b675c870d15ae1b98e796f5f09bdfa9d34e41 100644 (file)
@@ -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;