MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ithread_create

Function ithread_create

freebsd/kern/kern_intr.c:531–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529}
530
531static struct intr_thread *
532ithread_create(const char *name)
533{
534 struct intr_thread *ithd;
535 struct thread *td;
536 int error;
537
538 ithd = malloc(sizeof(struct intr_thread), M_ITHREAD, M_WAITOK | M_ZERO);
539
540 error = kproc_kthread_add(ithread_loop, ithd, &intrproc,
541 &td, RFSTOPPED | RFHIGHPID,
542 0, "intr", "%s", name);
543 if (error)
544 panic("kproc_create() failed with %d", error);
545 thread_lock(td);
546 sched_class(td, PRI_ITHD);
547 TD_SET_IWAIT(td);
548 thread_unlock(td);
549 td->td_pflags |= TDP_ITHREAD;
550 ithd->it_thread = td;
551 CTR2(KTR_INTR, "%s: created %s", __func__, name);
552 return (ithd);
553}
554
555static void
556ithread_destroy(struct intr_thread *ithread)

Callers 1

intr_event_add_handlerFunction · 0.85

Calls 4

mallocFunction · 0.85
kproc_kthread_addFunction · 0.70
panicFunction · 0.70
sched_classFunction · 0.70

Tested by

no test coverage detected