rt: Simplify the recv interface
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user