Support multithread server

This commit is contained in:
TXuian
2024-05-31 01:17:57 +08:00
parent d05754a98e
commit 3a99cc550c
8 changed files with 128 additions and 85 deletions
@@ -166,6 +166,10 @@ static void _dealloc_task_cb(struct Thread* task)
bitmap64_free(&task->memspace->thread_stack_idx_bitmap, task->thread_context.user_stack_idx);
/* thread's user stack space is also allocated for kernel free space */
assert(kfree((char*)task->thread_context.ustack_kvaddr));
if (task->memspace != NULL) {
task->memspace->mem_size -= USER_STACK_SIZE;
}
}
/* free thread's kernel stack */