rt: Simplify the recv interface

This commit is contained in:
Brian Anderson
2012-03-02 00:31:14 -08:00
parent 8e0efce0da
commit 77295c56c5
2 changed files with 13 additions and 21 deletions

View File

@@ -543,10 +543,8 @@ rust_task_yield(rust_task *task, bool *killed) {
}
extern "C" CDECL void
port_recv(uintptr_t *dptr, rust_port *port,
uintptr_t *yield, uintptr_t *killed) {
port_recv(uintptr_t *dptr, rust_port *port, uintptr_t *yield) {
*yield = false;
*killed = false;
rust_task *task = rust_task_thread::get_task();
{
scoped_lock with(port->lock);
@@ -559,13 +557,6 @@ port_recv(uintptr_t *dptr, rust_port *port,
return;
}
// If this task has been killed then we're not going to bother
// blocking, we have to unwind.
if (task->must_fail_from_being_killed()) {
*killed = true;
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.