sched_newthread question

Divacky Roman xdivac02 at stud.fit.vutbr.cz
Sat Mar 4 09:11:30 PST 2006


hi,

sched_newthread(struct thread *td)
{
           struct td_sched *ke;

	ke = (struct td_sched *) (td + 1);
	bzero(ke, sizeof(*ke));
	td->td_sched     = ke;
	ke->ke_thread   = td;
	ke->ke_state    = KES_THREAD;
}

whats the logic behind:
ke = (struct td_sched *) (td + 1); ? 

shouldnt it be:
ke = td -> td_sched; ?

thnx

roman


More information about the freebsd-hackers mailing list