From 0de94ed7c210bc4608127a271aab5568a723540f Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 16 Apr 2020 15:58:01 -0400 Subject: [PATCH] chore: cleanup additional run_queue logic --- runtime/src/runtime.c | 15 +-------------- runtime/src/sandbox_run_queue.c | 5 ++++- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/runtime/src/runtime.c b/runtime/src/runtime.c index 8ee694d..be3ff08 100644 --- a/runtime/src/runtime.c +++ b/runtime/src/runtime.c @@ -160,8 +160,6 @@ static __thread unsigned int worker_thread_is_in_callback; * Worker Thread Logic *************************************************/ -static inline void worker_thread_push_sandbox_to_run_queue(struct sandbox *sandbox); - /** * @brief Switches to the next sandbox, placing the current sandbox of the completion queue if in RETURNED state * @param next The Sandbox Context to switch to or NULL @@ -299,17 +297,6 @@ worker_thread_execute_libuv_event_loop(void) worker_thread_is_in_callback = 0; } - -/** - * Removes the thread from the thread-local runqueue - * @param sandbox sandbox - **/ -static inline void -worker_thread_pop_sandbox_from_run_queue(struct sandbox *sandbox) -{ - ps_list_rem_d(sandbox); -} - /** * Execute the sandbox at the head of the thread local runqueue * If the runqueue is empty, pull a fresh batch of sandbox requests, instantiate them, and then execute the new head @@ -438,7 +425,7 @@ worker_thread_exit_current_sandbox(void) struct sandbox *current_sandbox = current_sandbox_get(); assert(current_sandbox); software_interrupt_disable(); - worker_thread_pop_sandbox_from_run_queue(current_sandbox); + sandbox_run_queue_remove(current_sandbox); current_sandbox->state = RETURNED; struct sandbox *next_sandbox = worker_thread_get_next_sandbox(0); diff --git a/runtime/src/sandbox_run_queue.c b/runtime/src/sandbox_run_queue.c index fdb3abc..9dd76bc 100644 --- a/runtime/src/sandbox_run_queue.c +++ b/runtime/src/sandbox_run_queue.c @@ -21,7 +21,10 @@ sandbox_run_queue_get_head() return ps_list_head_first_d(&sandbox_run_queue, struct sandbox); } -// Remove a sandbox from the runqueue +/** + * Removes the thread from the thread-local runqueue + * @param sandbox sandbox + **/ void sandbox_run_queue_remove(struct sandbox *sandbox_to_remove) {