sched: enforce ref-counting on current task/thread pointers

This commit is contained in:
2026-04-01 18:17:05 +01:00
parent 15c2207ab9
commit 512356ac2d
28 changed files with 364 additions and 103 deletions
+4 -2
View File
@@ -159,6 +159,7 @@ kern_status_t vm_controller_recv(
spin_unlock(&req->req_lock);
if (req->req_status == PAGE_REQUEST_ASYNC) {
put_current_thread(req->req_sender);
vm_cache_free(&page_request_cache, req);
}
@@ -220,7 +221,7 @@ kern_status_t vm_controller_detach_object(
req->req_type = PAGE_REQUEST_DETACH;
req->req_status = PAGE_REQUEST_ASYNC;
req->req_object = vmo->vo_key;
req->req_sender = current_thread();
req->req_sender = get_current_thread();
send_request_async(ctrl, req);
vmo->vo_ctrl = NULL;
@@ -236,7 +237,7 @@ static void wait_for_reply(
unsigned long *lock_flags)
{
struct wait_item waiter;
struct thread *self = current_thread();
struct thread *self = get_current_thread();
wait_item_init(&waiter, self);
for (;;) {
@@ -251,6 +252,7 @@ static void wait_for_reply(
}
self->tr_state = THREAD_READY;
put_current_thread(self);
}
static void fulfill_requests(