Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2450 → Rev 2451

/trunk/kernel/generic/include/proc/thread.h
81,8 → 81,8
Entering,
/** After a thread calls thread_exit(), it is put into Exiting state. */
Exiting,
/** Threads that were not detached but exited are in the JoinMe state. */
JoinMe
/** Threads that were not detached but exited are Lingering. */
Lingering
} state_t;
 
/** Thread structure. There is one per thread. */
/trunk/kernel/generic/src/proc/scheduler.c
415,7 → 415,7
WAKEUP_FIRST);
spinlock_unlock(&THREAD->join_wq.lock);
THREAD->state = JoinMe;
THREAD->state = Lingering;
spinlock_unlock(&THREAD->lock);
}
break;
/trunk/kernel/generic/src/proc/thread.c
78,7 → 78,7
"Ready",
"Entering",
"Exiting",
"JoinMe"
"Lingering"
};
 
/** Lock protecting the threads_btree B+tree.
356,7 → 356,7
*/
void thread_destroy(thread_t *t)
{
ASSERT(t->state == Exiting || t->state == JoinMe);
ASSERT(t->state == Exiting || t->state == Lingering);
ASSERT(t->task);
ASSERT(t->cpu);
 
520,8 → 520,8
 
/** Detach thread.
*
* Mark the thread as detached, if the thread is already in the JoinMe state,
* deallocate its resources.
* Mark the thread as detached, if the thread is already in the Lingering
* state, deallocate its resources.
*
* @param t Thread to be detached.
*/
536,7 → 536,7
ipl = interrupts_disable();
spinlock_lock(&t->lock);
ASSERT(!t->detached);
if (t->state == JoinMe) {
if (t->state == Lingering) {
thread_destroy(t); /* unlocks &t->lock */
interrupts_restore(ipl);
return;