diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-05-01 17:39:56 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-05-03 16:38:16 -0700 |
| commit | beb1a59f82e7689b72bf10d2a86d0d1b6060983e (patch) | |
| tree | 6ac4ccf829472a5520bb5d91c1780773610ddc00 /src/rt/rust_builtin.cpp | |
| parent | 29b807be2a0d060e4321b28849e68596dc1a6b45 (diff) | |
| download | rust-beb1a59f82e7689b72bf10d2a86d0d1b6060983e.tar.gz rust-beb1a59f82e7689b72bf10d2a86d0d1b6060983e.zip | |
core: Add comm::recv_chan to receive from a channel
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 5866c1a8dc0..4ba6c299c62 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -631,6 +631,24 @@ sched_threads() { } extern "C" CDECL rust_port* +rust_port_take(rust_port_id id) { + rust_task *task = rust_get_current_task(); + return task->kernel->get_port_by_id(id); +} + +extern "C" CDECL void +rust_port_drop(rust_port *p) { + assert(p != NULL); + p->deref(); +} + +extern "C" CDECL rust_task_id +rust_port_task(rust_port *p) { + assert(p != NULL); + return p->task->id; +} + +extern "C" CDECL rust_port* new_port(size_t unit_sz) { rust_task *task = rust_get_current_task(); LOG(task, comm, "new_port(task=0x%" PRIxPTR " (%s), unit_sz=%d)", |
