From 2f23405a6079745663b9a4462410aa509f281aa1 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Thu, 11 Aug 2011 10:46:57 -0700 Subject: Working on more spawn test cases. --- src/rt/rust_builtin.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/rt/rust_builtin.cpp') diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 0c957cef3a9..d330fbff590 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -99,6 +99,12 @@ align_of(rust_task *task, type_desc *t) { return t->align; } +extern "C" CDECL void +leak(rust_task *task, type_desc *t, void *thing) { + // Do nothing. Call this with move-mode in order to say "Don't worry rust, + // I'll take care of this." +} + extern "C" CDECL intptr_t refcount(rust_task *task, type_desc *t, intptr_t *v) { @@ -283,7 +289,7 @@ task_yield(rust_task *task) { extern "C" CDECL intptr_t task_join(rust_task *task, rust_task_id tid) { // If the other task is already dying, we don't have to wait for it. - rust_task *join_task = task->kernel->get_task_by_id(tid); + smart_ptr join_task = task->kernel->get_task_by_id(tid); // FIXME: find task exit status and return that. if(!join_task) return 0; join_task->lock.lock(); @@ -728,7 +734,9 @@ get_task_pointer(rust_task *task, rust_task_id id) { extern "C" CDECL void start_task(rust_task *task, rust_task_id id) { - task->kernel->get_task_by_id(id)->start(); + rust_task * target = task->kernel->get_task_by_id(id); + + target->start(); } extern "C" void *task_trampoline asm("task_trampoline"); -- cgit 1.4.1-3-g733a5