mirror of
https://github.com/drasko/codezero.git
synced 2026-01-28 18:53:14 +01:00
Exiting tasks use EXITING signal and change states to TASK_DEAD
This commit is contained in:
@@ -437,6 +437,11 @@ struct capability *cap_match_thread(struct capability *cap,
|
||||
if (!(cap->access & CAP_TCTRL_RECYCLE))
|
||||
return 0;
|
||||
break;
|
||||
case THREAD_WAIT:
|
||||
if (!(cap->access & CAP_TCTRL_WAIT))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* We refuse to accept anything else */
|
||||
return 0;
|
||||
|
||||
@@ -225,6 +225,22 @@ void sched_resume_async(struct ktcb *task)
|
||||
RQ_ADD_FRONT);
|
||||
}
|
||||
|
||||
|
||||
/* Same as suspend, task state and flags are different */
|
||||
void sched_exit_sync(void)
|
||||
{
|
||||
preempt_disable();
|
||||
sched_rq_remove_task(current);
|
||||
current->state = TASK_DEAD;
|
||||
current->flags &= ~TASK_EXITING;
|
||||
preempt_enable();
|
||||
|
||||
if (current->pagerid != current->tid)
|
||||
wake_up(¤t->wqh_pager, 0);
|
||||
|
||||
schedule();
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: Could do these as sched_prepare_suspend()
|
||||
* + schedule() or need_resched = 1
|
||||
|
||||
Reference in New Issue
Block a user