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

Function sched_bind

freebsd/kern/sched_4bsd.c:1523–1542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1521}
1522
1523void
1524sched_bind(struct thread *td, int cpu)
1525{
1526 struct td_sched *ts;
1527
1528 THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED);
1529 KASSERT(td == curthread, ("sched_bind: can only bind curthread"));
1530
1531 ts = td_get_sched(td);
1532
1533 td->td_flags |= TDF_BOUND;
1534#ifdef SMP
1535 ts->ts_runq = &runq_pcpu[cpu];
1536 if (PCPU_GET(cpuid) == cpu)
1537 return;
1538
1539 mi_switch(SW_VOL);
1540 thread_lock(td);
1541#endif
1542}
1543
1544void
1545sched_unbind(struct thread* td)

Callers

nothing calls this directly

Calls 2

td_get_schedFunction · 0.85
mi_switchFunction · 0.70

Tested by

no test coverage detected