about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <mbebenita@mozilla.com>2010-09-07 18:39:07 -0700
committerMichael Bebenita <mbebenita@mozilla.com>2010-09-07 18:44:12 -0700
commitde611a309006f0976bc9a579eb1087e7a89f79a7 (patch)
treecd30b33ab1986c0cc84e0fc0743593bd99b0caaa /src/rt/rust_task.cpp
parenta6aebdaedd4abb95b040c9cd09cfdb6b9b940789 (diff)
downloadrust-de611a309006f0976bc9a579eb1087e7a89f79a7.tar.gz
rust-de611a309006f0976bc9a579eb1087e7a89f79a7.zip
Lots of design changes around proxies and message passing. Made it so that domains can only talk to other domains via handles, and with the help of the rust_kernel.
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 08d5974ecbb..408996f69db 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -404,9 +404,10 @@ rust_task::notify_tasks_waiting_to_join() {
         tasks_waiting_to_join.pop(&waiting_task);
         if (waiting_task->is_proxy()) {
             notify_message::send(notify_message::WAKEUP, "wakeup",
-                                 this, waiting_task->as_proxy());
+                get_handle(), waiting_task->as_proxy()->handle());
+            delete waiting_task;
         } else {
-            rust_task *task = waiting_task->delegate();
+            rust_task *task = waiting_task->referent();
             if (task->dead() == false) {
                 task->wakeup(this);
             }
@@ -563,8 +564,7 @@ rust_task::transition(ptr_vec<rust_task> *src, ptr_vec<rust_task> *dst)
 }
 
 void
-rust_task::block(rust_cond *on, const char* name)
-{
+rust_task::block(rust_cond *on, const char* name) {
     log(rust_log::TASK, "Blocking on 0x%" PRIxPTR ", cond: 0x%" PRIxPTR,
                          (uintptr_t) on, (uintptr_t) cond);
     A(dom, cond == NULL, "Cannot block an already blocked task.");
@@ -631,6 +631,11 @@ rust_task::log(uint32_t type_bits, char const *fmt, ...) {
     }
 }
 
+rust_handle<rust_task> *
+rust_task::get_handle() {
+    return dom->kernel->get_task_handle(this);
+}
+
 //
 // Local Variables:
 // mode: C++