Introduced task handles.

This is the new way to refer to tasks in rust-land. Currently all they
do is serve as a key to look up the old rust_task structure. Ideally
they won't be ref counted, but baby steps.
This commit is contained in:
unknown
2011-08-08 13:38:20 -07:00
committed by Eric Holk
parent f4f057ced1
commit 44bef5f2cb
14 changed files with 75 additions and 38 deletions

View File

@@ -408,8 +408,11 @@ task_yield(rust_task *task) {
}
extern "C" CDECL intptr_t
task_join(rust_task *task, rust_task *join_task) {
task_join(rust_task *task, rust_task_id tid) {
// 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);