diff --git a/runtime/include/global_request_scheduler.h b/runtime/include/global_request_scheduler.h index e699366..a7cc14e 100644 --- a/runtime/include/global_request_scheduler.h +++ b/runtime/include/global_request_scheduler.h @@ -14,12 +14,7 @@ struct global_request_scheduler_config { }; -void global_request_scheduler_initialize(struct global_request_scheduler_config *config); - -#define GLOBAL_REQUEST_SCHEDULER_REMOVE_OK 0 -#define GLOBAL_REQUEST_SCHEDULER_REMOVE_EMPTY -1 -#define GLOBAL_REQUEST_SCHEDULER_REMOVE_NOLOCK -2 - +void global_request_scheduler_initialize(struct global_request_scheduler_config *config); struct sandbox_request *global_request_scheduler_add(struct sandbox_request *); int global_request_scheduler_remove(struct sandbox_request **); uint64_t global_request_scheduler_peek(); diff --git a/runtime/src/local_runqueue_list.c b/runtime/src/local_runqueue_list.c index ed27296..4759c4f 100644 --- a/runtime/src/local_runqueue_list.c +++ b/runtime/src/local_runqueue_list.c @@ -47,7 +47,7 @@ local_runqueue_list_get_next() // If our local runqueue is empty, try to pull and allocate a sandbox request from the global request scheduler if (local_runqueue_is_empty()) { - if (global_request_scheduler_remove(&sandbox_request) != GLOBAL_REQUEST_SCHEDULER_REMOVE_OK) goto err; + if (global_request_scheduler_remove(&sandbox_request) < 0) goto err; struct sandbox *sandbox = sandbox_allocate(sandbox_request); if (!sandbox) goto sandbox_allocate_err; diff --git a/runtime/src/local_runqueue_minheap.c b/runtime/src/local_runqueue_minheap.c index 6ad8c7a..10b0bc6 100644 --- a/runtime/src/local_runqueue_minheap.c +++ b/runtime/src/local_runqueue_minheap.c @@ -87,7 +87,7 @@ local_runqueue_minheap_get_next() local_runqueue_minheap_add(sandbox); } else if (sandbox_rc == -1) { /* local runqueue was empty, try to pull a sandbox request and return NULL if we're unable to get one */ - if (global_request_scheduler_remove(&sandbox_request) != GLOBAL_REQUEST_SCHEDULER_REMOVE_OK) goto err; + if (global_request_scheduler_remove(&sandbox_request) < 0) goto err; /* Try to allocate a sandbox, returning the request on failure */ sandbox = sandbox_allocate(sandbox_request);