MCPcopy Create free account
hub / github.com/HelenOS/helenos / task_kill

Function task_kill

kernel/generic/src/proc/task.c:566–583  ·  view source on GitHub ↗

Kill task. * * This function is idempotent. * It signals all the task's threads to bail it out. * * @param id ID of the task to be killed. * * @return Zero on success or an error code from errno.h. * */

Source from the content-addressed store, hash-verified

564 *
565 */
566errno_t task_kill(task_id_t id)
567{
568 if (id == 1)
569 return EPERM;
570
571 irq_spinlock_lock(&tasks_lock, true);
572
573 task_t *task = task_find_by_id(id);
574 if (!task) {
575 irq_spinlock_unlock(&tasks_lock, true);
576 return ENOENT;
577 }
578
579 task_kill_internal(task);
580 irq_spinlock_unlock(&tasks_lock, true);
581
582 return EOK;
583}
584
585/** Kill the currently running task.
586 *

Callers 2

sys_task_killFunction · 0.70
cmd_killFunction · 0.50

Calls 4

irq_spinlock_lockFunction · 0.85
task_find_by_idFunction · 0.85
irq_spinlock_unlockFunction · 0.85
task_kill_internalFunction · 0.85

Tested by

no test coverage detected