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

Function task_kill_internal

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

Source from the content-addressed store, hash-verified

526}
527
528static void task_kill_internal(task_t *task)
529{
530 irq_spinlock_lock(&task->lock, false);
531 irq_spinlock_lock(&threads_lock, false);
532
533 /*
534 * Interrupt all threads.
535 */
536
537 list_foreach(task->threads, th_link, thread_t, thread) {
538 bool sleeping = false;
539
540 irq_spinlock_lock(&thread->lock, false);
541
542 thread->interrupted = true;
543 if (thread->state == Sleeping)
544 sleeping = true;
545
546 irq_spinlock_unlock(&thread->lock, false);
547
548 if (sleeping)
549 waitq_interrupt_sleep(thread);
550 }
551
552 irq_spinlock_unlock(&threads_lock, false);
553 irq_spinlock_unlock(&task->lock, false);
554}
555
556/** Kill task.
557 *

Callers 3

task_doneFunction · 0.85
task_killFunction · 0.85
task_kill_selfFunction · 0.85

Calls 3

irq_spinlock_lockFunction · 0.85
irq_spinlock_unlockFunction · 0.85
waitq_interrupt_sleepFunction · 0.85

Tested by

no test coverage detected