]> xenbits.xensource.com Git - unikraft/libs/click.git/commitdiff
click.cc: Update sched-related functions
authorStefan Jumarea <stefanjumarea02@gmail.com>
Fri, 8 Sep 2023 12:33:04 +0000 (15:33 +0300)
committerUnikraft <monkey@unikraft.io>
Sat, 9 Sep 2023 12:15:03 +0000 (12:15 +0000)
Update the sched-related functions to match the changes to the Unikraft
core. Update the thread creation functions and change the `thread_wait`
function to a loop that waits for the thread to end.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #7

click.cc

index c2b7478ea2802fdf12e88093706702338671a69b..1ab0076db15f17dfee726ab5c3259a953e3a3ff1 100644 (file)
--- a/click.cc
+++ b/click.cc
@@ -421,8 +421,9 @@ int CLICK_MAIN(int argc, char **argv)
                on_router((*path + strlen(PATH_ROOT)), val);
        }
 #else
-       router = uk_thread_create("click-router", router_thread, 0);
-       uk_thread_wait(router);
+       router = uk_sched_thread_create(uk_sched_current(), router_thread, 0, "click-router");
+       while (!uk_thread_is_exited(router))
+               uk_sched_yield();
 #endif
        LOG("Shutting down...");