kernel: rebuild object ref-counting using atomic types
This commit is contained in:
@@ -38,7 +38,7 @@ kern_status_t sys_task_self(kern_handle_t *out)
|
||||
return status;
|
||||
}
|
||||
|
||||
object_add_handle(&self->t_base);
|
||||
object_ref(&self->t_base);
|
||||
handle_slot->h_object = &self->t_base;
|
||||
|
||||
*out = handle;
|
||||
@@ -129,8 +129,8 @@ kern_status_t sys_task_create(
|
||||
child_handle_slot->h_object = &child->t_base;
|
||||
space_handle_slot->h_object = &child->t_address_space->s_base;
|
||||
|
||||
object_add_handle(&child->t_base);
|
||||
object_add_handle(&child->t_address_space->s_base);
|
||||
object_ref(&child->t_base);
|
||||
object_ref(&child->t_address_space->s_base);
|
||||
|
||||
object_unref(parent_obj);
|
||||
|
||||
@@ -199,7 +199,7 @@ kern_status_t sys_task_create_thread(
|
||||
|
||||
thread_init_user(thread, ip, sp, args, nr_args);
|
||||
target_handle->h_object = &thread->tr_base;
|
||||
object_add_handle(&thread->tr_base);
|
||||
object_ref(&thread->tr_base);
|
||||
|
||||
task_unlock_irqrestore(target, flags);
|
||||
object_unref(target_obj);
|
||||
@@ -254,7 +254,7 @@ kern_status_t sys_task_get_address_space(
|
||||
}
|
||||
|
||||
handle_slot->h_object = &task->t_address_space->s_base;
|
||||
object_add_handle(&task->t_address_space->s_base);
|
||||
object_ref(&task->t_address_space->s_base);
|
||||
task_unlock_irqrestore(self, flags);
|
||||
object_unref(task_obj);
|
||||
|
||||
@@ -286,7 +286,7 @@ kern_status_t sys_thread_self(kern_handle_t *out)
|
||||
return status;
|
||||
}
|
||||
|
||||
object_add_handle(&self_thread->tr_base);
|
||||
object_ref(&self_thread->tr_base);
|
||||
handle_slot->h_object = &self_thread->tr_base;
|
||||
|
||||
*out = handle;
|
||||
|
||||
Reference in New Issue
Block a user