Remove task::join_id
This is the old, racy way of joining to a task. It is no longer used.
This commit is contained in:
parent
4d669036f3
commit
17c651b3b0
@ -27,7 +27,6 @@ native "cdecl" mod rustrt {
|
||||
fn task_sleep(time_in_us: uint);
|
||||
fn task_yield();
|
||||
fn start_task(id: task_id, closure: *u8);
|
||||
fn task_join(t: task_id) -> int;
|
||||
}
|
||||
|
||||
native "c-stack-cdecl" mod rustrt2 = "rustrt" {
|
||||
@ -83,10 +82,6 @@ fn join(task_port: (task_id, comm::port<task_notification>)) -> task_result {
|
||||
}
|
||||
}
|
||||
|
||||
fn join_id(t: task_id) -> task_result {
|
||||
alt rustrt::task_join(t) { 0 { tr_success } _ { tr_failure } }
|
||||
}
|
||||
|
||||
fn unsupervise() { ret sys::unsupervise(); }
|
||||
|
||||
fn pin() { rustrt2::pin_task(); }
|
||||
|
@ -177,32 +177,6 @@ task_yield() {
|
||||
task->yield(1);
|
||||
}
|
||||
|
||||
extern "C" CDECL intptr_t
|
||||
task_join(rust_task_id tid) {
|
||||
rust_task *task = rust_scheduler::get_task();
|
||||
// If the other task is already dying, we don't have to wait for it.
|
||||
rust_task *join_task = task->kernel->get_task_by_id(tid);
|
||||
// FIXME: find task exit status and return that.
|
||||
if(!join_task) return 0;
|
||||
join_task->lock.lock();
|
||||
if (join_task->dead() == false) {
|
||||
join_task->tasks_waiting_to_join.push(task);
|
||||
task->block(join_task, "joining local task");
|
||||
join_task->lock.unlock();
|
||||
task->yield(2);
|
||||
}
|
||||
else {
|
||||
join_task->lock.unlock();
|
||||
}
|
||||
if (!join_task->failed) {
|
||||
join_task->deref();
|
||||
return 0;
|
||||
} else {
|
||||
join_task->deref();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Debug builtins for std::dbg. */
|
||||
|
||||
static void
|
||||
|
@ -61,7 +61,6 @@ vec_reserve_shared
|
||||
vec_from_buf_shared
|
||||
task_sleep
|
||||
task_yield
|
||||
task_join
|
||||
unsupervise
|
||||
upcall_alloc_c_stack
|
||||
upcall_call_c_stack
|
||||
|
Loading…
x
Reference in New Issue
Block a user