rt: Convert rust_task_list to a typedef

This commit is contained in:
Brian Anderson 2012-03-17 18:25:06 -07:00
parent 47c1895724
commit 5d4bf75f56
6 changed files with 2 additions and 49 deletions

View File

@ -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 \

View File

@ -145,8 +145,6 @@ template <typename T> 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).

View File

@ -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;
}
}

View File

@ -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<rust_task>,
public kernel_owned<rust_task_list> {
public:
rust_task_thread *thread;
rust_task_list (rust_task_thread *thread);
void delete_all();
};
#endif /* RUST_TASK_LIST_H */

View File

@ -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;

View File

@ -19,6 +19,8 @@ enum rust_task_state {
task_state_dead
};
typedef indexed_list<rust_task> rust_task_list;
struct rust_task_thread : public kernel_owned<rust_task_thread>,
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();