summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-08-11 10:46:57 -0700
committerEric Holk <eholk@mozilla.com>2011-08-15 09:26:51 -0700
commit2f23405a6079745663b9a4462410aa509f281aa1 (patch)
tree88195a7b5dfe11c25cfe66880ba97abfc2fb0787 /src/rt/rust_builtin.cpp
parenta3320435610364457bf4ae08d1de64c3a96fca68 (diff)
downloadrust-2f23405a6079745663b9a4462410aa509f281aa1.tar.gz
rust-2f23405a6079745663b9a4462410aa509f281aa1.zip
Working on more spawn test cases.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp12
1 files changed, 10 insertions, 2 deletions
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<rust_task> 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");