version 1.69.4.2, 2007/11/06 23:31:40 |
version 1.69.4.3, 2007/11/08 11:00:01 |
Line 569 lwp_create(lwp_t *l1, proc_t *p2, vaddr_ |
|
Line 569 lwp_create(lwp_t *l1, proc_t *p2, vaddr_ |
|
if (isfree == NULL) { |
if (isfree == NULL) { |
l2 = pool_get(&lwp_pool, PR_WAITOK); |
l2 = pool_get(&lwp_pool, PR_WAITOK); |
memset(l2, 0, sizeof(*l2)); |
memset(l2, 0, sizeof(*l2)); |
l2->l_ts = pool_cache_get(&turnstile_cache, PR_WAITOK); |
l2->l_ts = pool_cache_get(turnstile_cache, PR_WAITOK); |
SLIST_INIT(&l2->l_pi_lenders); |
SLIST_INIT(&l2->l_pi_lenders); |
} else { |
} else { |
l2 = isfree; |
l2 = isfree; |
Line 924 lwp_free(struct lwp *l, bool recycle, bo |
|
Line 924 lwp_free(struct lwp *l, bool recycle, bo |
|
sched_lwp_exit(l); |
sched_lwp_exit(l); |
|
|
if (!recycle && l->l_ts != &turnstile0) |
if (!recycle && l->l_ts != &turnstile0) |
pool_cache_put(&turnstile_cache, l->l_ts); |
pool_cache_put(turnstile_cache, l->l_ts); |
#ifndef __NO_CPU_LWP_FREE |
#ifndef __NO_CPU_LWP_FREE |
cpu_lwp_free2(l); |
cpu_lwp_free2(l); |
#endif |
#endif |
Line 1331 lwp_delref(struct lwp *l) |
|
Line 1331 lwp_delref(struct lwp *l) |
|
KASSERT(l->l_stat != LSZOMB); |
KASSERT(l->l_stat != LSZOMB); |
KASSERT(l->l_refcnt > 0); |
KASSERT(l->l_refcnt > 0); |
if (--l->l_refcnt == 0) |
if (--l->l_refcnt == 0) |
cv_broadcast(&p->p_refcv); |
cv_broadcast(&p->p_lwpcv); |
mutex_exit(&p->p_smutex); |
mutex_exit(&p->p_smutex); |
} |
} |
|
|
Line 1348 lwp_drainrefs(struct lwp *l) |
|
Line 1348 lwp_drainrefs(struct lwp *l) |
|
|
|
l->l_refcnt--; |
l->l_refcnt--; |
while (l->l_refcnt != 0) |
while (l->l_refcnt != 0) |
cv_wait(&p->p_refcv, &p->p_smutex); |
cv_wait(&p->p_lwpcv, &p->p_smutex); |
} |
} |
|
|
/* |
/* |