diff options
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r-- | sys/kern/kern_thr.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 37e3df2..2769f45 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -142,18 +142,12 @@ create_thread(struct thread *td, mcontext_t *ctx, { stack_t stack; struct thread *newtd; -#ifdef KSE - struct ksegrp *kg, *newkg; -#endif struct proc *p; long id; int error; error = 0; p = td->td_proc; -#ifdef KSE - kg = td->td_ksegrp; -#endif /* Have race condition but it is cheap. */ if (p->p_numthreads >= max_threads_per_proc) @@ -177,7 +171,7 @@ create_thread(struct thread *td, mcontext_t *ctx, } } - /* Initialize our td and new ksegrp.. */ + /* Initialize our td */ newtd = thread_alloc(); /* @@ -229,50 +223,22 @@ create_thread(struct thread *td, mcontext_t *ctx, } } -#ifdef KSE - newkg = ksegrp_alloc(); - bzero(&newkg->kg_startzero, - __rangeof(struct ksegrp, kg_startzero, kg_endzero)); - bcopy(&kg->kg_startcopy, &newkg->kg_startcopy, - __rangeof(struct ksegrp, kg_startcopy, kg_endcopy)); - sched_init_concurrency(newkg); PROC_LOCK(td->td_proc); td->td_proc->p_flag |= P_HADTHREADS; newtd->td_sigmask = td->td_sigmask; mtx_lock_spin(&sched_lock); - ksegrp_link(newkg, p); - thread_link(newtd, newkg); - PROC_UNLOCK(p); -#else - PROC_LOCK(td->td_proc); - td->td_proc->p_flag |= P_HADTHREADS; - newtd->td_sigmask = td->td_sigmask; - mtx_lock_spin(&sched_lock); thread_link(newtd, p); PROC_UNLOCK(p); -#endif -#ifdef KSE /* let the scheduler know about these things. */ - sched_fork_ksegrp(td, newkg); sched_fork_thread(td, newtd); if (rtp != NULL) { - if (!(kg->kg_pri_class == PRI_TIMESHARE && - rtp->type == RTP_PRIO_NORMAL)) { - rtp_to_pri(rtp, newkg); - sched_prio(newtd, newkg->kg_user_pri); - } /* ignore timesharing class */ - } -#else - sched_fork(td, newtd); - if (rtp != NULL) { if (!(td->td_pri_class == PRI_TIMESHARE && rtp->type == RTP_PRIO_NORMAL)) { rtp_to_pri(rtp, newtd); sched_prio(newtd, newtd->td_user_pri); } /* ignore timesharing class */ } -#endif TD_SET_CAN_RUN(newtd); /* if ((flags & THR_SUSPENDED) == 0) */ setrunqueue(newtd, SRQ_BORING); |