From 5d4bf75f56a10c4d15acb3ecb3d33aeea5511806 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 17 Mar 2012 18:25:06 -0700 Subject: [PATCH] rt: Convert rust_task_list to a typedef --- mk/rt.mk | 2 -- src/rt/rust_internal.h | 2 -- src/rt/rust_task_list.cpp | 15 --------------- src/rt/rust_task_list.h | 16 ---------------- src/rt/rust_task_thread.cpp | 13 ------------- src/rt/rust_task_thread.h | 3 ++- 6 files changed, 2 insertions(+), 49 deletions(-) delete mode 100644 src/rt/rust_task_list.cpp delete mode 100644 src/rt/rust_task_list.h diff --git a/mk/rt.mk b/mk/rt.mk index 1e079e2f556..1dddfef3161 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -45,7 +45,6 @@ RUNTIME_CS_$(1) := \ rt/rust_scheduler.cpp \ rt/rust_task.cpp \ rt/rust_stack.cpp \ - rt/rust_task_list.cpp \ rt/rust_port.cpp \ rt/rust_upcall.cpp \ rt/rust_uv.cpp \ @@ -83,7 +82,6 @@ RUNTIME_HDR_$(1) := rt/globals.h \ rt/rust_shape.h \ rt/rust_task.h \ rt/rust_stack.h \ - rt/rust_task_list.h \ rt/rust_log.h \ rt/rust_port_selector.h \ rt/circular_buffer.h \ diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index 55f344f150d..e5e4af73cab 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -145,8 +145,6 @@ template struct region_owned { } }; -#include "rust_task_list.h" - // A cond(ition) is something we can block on. This can be a channel // (writing), a port (reading) or a task (waiting). diff --git a/src/rt/rust_task_list.cpp b/src/rt/rust_task_list.cpp deleted file mode 100644 index 998dcb80759..00000000000 --- a/src/rt/rust_task_list.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "rust_internal.h" - -rust_task_list::rust_task_list (rust_task_thread *thread) : - thread(thread) { -} - -void -rust_task_list::delete_all() { - DLOG(thread, task, "deleting all tasks"); - while (is_empty() == false) { - rust_task *task = pop_value(); - DLOG(thread, task, "deleting task " PTR, task); - delete task; - } -} diff --git a/src/rt/rust_task_list.h b/src/rt/rust_task_list.h deleted file mode 100644 index d5aa0c5162a..00000000000 --- a/src/rt/rust_task_list.h +++ /dev/null @@ -1,16 +0,0 @@ -// -*- c++ -*- -#ifndef RUST_TASK_LIST_H -#define RUST_TASK_LIST_H - -/** - * Used to indicate the state of a rust task. - */ -class rust_task_list : public indexed_list, - public kernel_owned { -public: - rust_task_thread *thread; - rust_task_list (rust_task_thread *thread); - void delete_all(); -}; - -#endif /* RUST_TASK_LIST_H */ diff --git a/src/rt/rust_task_thread.cpp b/src/rt/rust_task_thread.cpp index 6997309fee3..1a90aae2c1b 100644 --- a/src/rt/rust_task_thread.cpp +++ b/src/rt/rust_task_thread.cpp @@ -27,10 +27,6 @@ rust_task_thread::rust_task_thread(rust_scheduler *sched, id(id), should_exit(false), cached_c_stack(NULL), - newborn_tasks(this), - running_tasks(this), - blocked_tasks(this), - dead_tasks(this), kernel(sched->kernel), sched(sched), srv(srv), @@ -47,15 +43,6 @@ rust_task_thread::rust_task_thread(rust_scheduler *sched, init_tls(); } -rust_task_thread::~rust_task_thread() { - DLOG(this, dom, "~rust_task_thread %s @0x%" PRIxPTR, name, (uintptr_t)this); - - newborn_tasks.delete_all(); - running_tasks.delete_all(); - blocked_tasks.delete_all(); - dead_tasks.delete_all(); -} - void rust_task_thread::activate(rust_task *task) { task->ctx.next = &c_context; diff --git a/src/rt/rust_task_thread.h b/src/rt/rust_task_thread.h index 8bfed4221ce..c1f8eabef03 100644 --- a/src/rt/rust_task_thread.h +++ b/src/rt/rust_task_thread.h @@ -19,6 +19,8 @@ enum rust_task_state { task_state_dead }; +typedef indexed_list rust_task_list; + struct rust_task_thread : public kernel_owned, rust_thread { @@ -80,7 +82,6 @@ public: // Only a pointer to 'name' is kept, so it must live as long as this // domain. rust_task_thread(rust_scheduler *sched, rust_srv *srv, int id); - ~rust_task_thread(); void activate(rust_task *task); void log(rust_task *task, uint32_t level, char const *fmt, ...); rust_log & get_log();