about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-08-15 16:54:02 -0700
committerEric Holk <eholk@mozilla.com>2011-08-16 09:36:29 -0700
commitcf2def46c120d8d6ef8a98571a39bef478c8c2a9 (patch)
tree902078db51847e2c3badb941dcbceeb5216d866f /src/rt/rust_task.cpp
parente33af7e0b505de6d7c754d2ead26c9ee2bc8974e (diff)
downloadrust-cf2def46c120d8d6ef8a98571a39bef478c8c2a9.tar.gz
rust-cf2def46c120d8d6ef8a98571a39bef478c8c2a9.zip
Removed trans_comm.rs from the compiler. Updating aio/sio to work with the new chan and port system, started on a networking module for the standard library.
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 148996f0008..8ef83488513 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -527,6 +527,17 @@ rust_port *rust_task::get_port_by_id(rust_port_id id) {
     return port;
 }
 
+rust_chan *rust_task::get_chan_by_handle(chan_handle *handle) {
+    rust_task *target_task = kernel->get_task_by_id(handle->task);
+    if(target_task) {
+        rust_port *port = target_task->get_port_by_id(handle->port);
+        target_task->deref();
+        port->remote_chan->ref();
+        return port->remote_chan;
+    }
+    return NULL;
+}
+
 //
 // Local Variables:
 // mode: C++