Support kernel semaphore.
This commit is contained in:
@@ -74,6 +74,7 @@ static void _task_manager_init()
|
||||
slab_init(&xizi_task_manager.memspace_allocator, sizeof(struct MemSpace));
|
||||
slab_init(&xizi_task_manager.task_allocator, sizeof(struct Thread));
|
||||
slab_init(&xizi_task_manager.task_buddy_allocator, sizeof(struct KBuddy));
|
||||
semaphore_pool_init(&xizi_task_manager.semaphore_pool);
|
||||
|
||||
// tid pool
|
||||
xizi_task_manager.next_pid = 0;
|
||||
@@ -321,13 +322,14 @@ static void _task_yield_noschedule(struct Thread* task, bool blocking)
|
||||
task_node_add_to_ready_list_back(task);
|
||||
}
|
||||
|
||||
static void _task_block(struct Thread* task)
|
||||
static void _task_block(struct double_list_node* head, struct Thread* task)
|
||||
{
|
||||
assert(head != NULL);
|
||||
assert(task != NULL);
|
||||
assert(task->state != RUNNING);
|
||||
task_node_leave_list(task);
|
||||
task->state = BLOCKED;
|
||||
doubleListAddOnHead(&task->node, &xizi_task_manager.task_blocked_list_head);
|
||||
doubleListAddOnHead(&task->node, head);
|
||||
}
|
||||
|
||||
static void _task_unblock(struct Thread* task)
|
||||
|
||||
Reference in New Issue
Block a user