]> git.lizzy.rs Git - rust.git/commitdiff
Remove task::join_id
authorBrian Anderson <banderson@mozilla.com>
Thu, 27 Oct 2011 03:39:02 +0000 (20:39 -0700)
committerBrian Anderson <banderson@mozilla.com>
Thu, 27 Oct 2011 03:43:47 +0000 (20:43 -0700)
This is the old, racy way of joining to a task. It is no longer used.

src/lib/task.rs
src/rt/rust_builtin.cpp
src/rt/rustrt.def.in

index 0a44026ea52b542e911a3bd43b146c7ff69a1282..5470cb06c9c75b1dbe80a88aa19d55f9bd16444f 100644 (file)
@@ -27,7 +27,6 @@
     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(); }
index 7deeb31cca14e85c7ffcbd0da3880dafc1af0fb9..d05682170d2aa160caa748e5dbb21ba690fcd98d 100644 (file)
@@ -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
index 8293a23d126cf7a7a6c2a215d188c3a71ec038ea..192774d350fef4dd179fdc43085b68042746b831 100644 (file)
@@ -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