Synopsis: pthread_exit() final thread hangs

State-Changed-From-To: open->analyzed
State-Changed-By: guenther
State-Changed-When: Mon Jul 12 21:33:44 MDT 2010
State-Changed-Why: 
What's happening is that the new thread exits the first time it is scheduled,
at uthread_create.c:215.  Thus, when the gc thread is started by the
recursive call at uthread_create.c:221, the nested call thinks that *another*
gc thread needs to be started.  You thus end up with two gc threads, each
waiting for the other to exit.  The Right Thing would be to factor out the
core logic of pthread_create() so that the recursive call could explictly
disable or avoid the "got gc?" check.  The Quick Thing would be to change
the check at uthread_create.c:182 to something like:
        f_gc = (TAILQ_FIRST(&_thread_list) == _thread_initial &&
            start_routine != _thread_gc);
...or something like that.

Reply via email to