summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <mbebenita@mozilla.com>2010-08-27 18:26:36 -0700
committerMichael Bebenita <mbebenita@mozilla.com>2010-09-07 18:41:07 -0700
commitf8ff013e3cc737b92b5a140dfd0ddcc5ab6773d9 (patch)
tree84daaf59d1eb899021e681927e1103cf08b91dd5 /src/rt/rust_upcall.cpp
parentffdb5fc8582c77eef7b3a30859eaa216872525a4 (diff)
downloadrust-f8ff013e3cc737b92b5a140dfd0ddcc5ab6773d9.tar.gz
rust-f8ff013e3cc737b92b5a140dfd0ddcc5ab6773d9.zip
Added a few utility classes, cleaned up the include order of .h files, and started to make the Rust kernel own domain message queues rather than the Rust domains themselves.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 954e7a13ded..0e3961bc24c 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -567,11 +567,9 @@ static void *rust_thread_start(void *ptr)
 
     // Start a new rust main loop for this thread.
     dom->start_main_loop();
-
     rust_srv *srv = dom->srv;
+    srv->kernel->deregister_domain(dom);
     delete dom;
-    delete srv;
-
     return 0;
 }
 
@@ -611,10 +609,10 @@ upcall_new_thread(rust_task *task, const char *name) {
     LOG_UPCALL_ENTRY(task);
 
     rust_dom *old_dom = task->dom;
-    rust_dom *new_dom = new rust_dom(old_dom->srv->clone(),
+    rust_dom *new_dom = new rust_dom(old_dom->srv,
                                      old_dom->root_crate,
                                      name);
-
+    old_dom->srv->kernel->register_domain(new_dom);
     task->log(rust_log::UPCALL | rust_log::MEM,
               "upcall new_thread(%s) = dom 0x%" PRIxPTR " task 0x%" PRIxPTR,
               name, new_dom, new_dom->root_task);