From cf2def46c120d8d6ef8a98571a39bef478c8c2a9 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Mon, 15 Aug 2011 16:54:02 -0700 Subject: 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. --- src/rt/rust_task.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/rt/rust_task.cpp') 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++ -- cgit 1.4.1-3-g733a5