Deleted Added
full compact
33c33
< * $FreeBSD: head/lib/libkse/thread/thr_create.c 113661 2003-04-18 07:09:43Z deischen $
---
> * $FreeBSD: head/lib/libkse/thread/thr_create.c 113786 2003-04-21 04:02:56Z deischen $
106c106,112
< crit = _kse_critical_enter();
---
> /*
> * Turn on threaded mode, if failed, it is unnecessary to
> * do further work.
> */
> if (_kse_isthreaded() == 0 && _kse_setthreaded(1)) {
> return (EAGAIN);
> }
108d113
< curkse = curthread->kse;
110c115,119
< /* Allocate memory for the thread structure: */
---
> /*
> * Allocate memory for the thread structure.
> * Some functions use malloc, so don't put it
> * in a critical region.
> */
137a147,148
> crit = _kse_critical_enter();
> curkse = _get_curkse();
138a150
> /* Stack routines don't use malloc/free. */
140a153
> _kse_critical_leave(crit);
172c185,189
< /* Initialize the machine context: */
---
> /*
> * Initialize the machine context.
> * Enter a critical region to get consistent context.
> */
> crit = _kse_critical_enter();
173a191
> _kse_critical_leave(crit);
181d198
<
185d201
<
191c207,212
< /* Copy the scheduling attributes: */
---
> /*
> * Copy the scheduling attributes.
> * Lock the scheduling lock to get consistent
> * scheduling parameters.
> */
> THR_SCHED_LOCK(curthread, curthread);
199a221
> THR_SCHED_UNLOCK(curthread, curthread);
215c237,241
< /* Initialize thread locking. */
---
> /*
> * Initialize thread locking.
> * Lock initializing needs malloc, so don't
> * enter critical region before doing this!
> */
247a274
> #ifdef NOT_YET
248a276
> #endif
254d281
< KSE_LOCK_ACQUIRE(curthread->kse, &_thread_list_lock);
255a283,284
> crit = _kse_critical_enter();
> KSE_LOCK_ACQUIRE(curthread->kse, &_thread_list_lock);
261d289
<
264d291
<
271a299
> _kse_critical_leave(crit);
277d304
< _kse_critical_leave(crit);
279,281d305
< if ((ret == 0) && (_kse_isthreaded() == 0))
< _kse_setthreaded(1);
<