diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-02 00:55:27 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-05 19:39:56 -0800 |
| commit | e08f46db68b43334e5932ac5eac308ce74f0771e (patch) | |
| tree | c7f3abc65418ab58ee90f957a76f933b6f830cf9 /src/rt/rust_builtin.cpp | |
| parent | 77295c56c5b7edec061cbcd374ef584171088cbc (diff) | |
| download | rust-e08f46db68b43334e5932ac5eac308ce74f0771e.tar.gz rust-e08f46db68b43334e5932ac5eac308ce74f0771e.zip | |
rt: Move receive code into rust_port
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index d37245c29a4..b6ad9397e9c 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -544,29 +544,7 @@ rust_task_yield(rust_task *task, bool *killed) { extern "C" CDECL void port_recv(uintptr_t *dptr, rust_port *port, uintptr_t *yield) { - *yield = false; - rust_task *task = rust_task_thread::get_task(); - { - scoped_lock with(port->lock); - - LOG(task, comm, "port: 0x%" PRIxPTR ", dptr: 0x%" PRIxPTR - ", size: 0x%" PRIxPTR, - (uintptr_t) port, (uintptr_t) dptr, port->unit_sz); - - if (port->receive(dptr)) { - return; - } - - // No data was buffered on any incoming channel, so block this task on - // the port. Remember the rendezvous location so that any sender task - // can write to it before waking up this task. - - LOG(task, comm, "<=== waiting for rendezvous data ==="); - task->rendezvous_ptr = dptr; - task->block(port, "waiting for rendezvous data"); - } - *yield = true; - return; + port->receive(dptr, yield); } extern "C" CDECL void |
