And on the third hand, if I understood the code correctly ...

src/threads.c: 40: thread_func()
src/threads.c: 53: interpreter->thread_data->state |= THREAD_STATE_FINISHED;


src/threads.c: 312: pt_thread_join ()
src/threads.c: 321: if (interpreter->thread_data->state == THREAD_STATE_JOINABLE ||
src/threads.c: 322: interpreter->thread_data->state == THREAD_STATE_FINISHED) {


src/threads.c: 453: detach()
src/threads.c: 462: if (interpreter->thread_data->state == THREAD_STATE_JOINABLE ||
src/threads.c: 463: interpreter->thread_data->state == THREAD_STATE_FINISHED) {


lines 322, 463 never hold true, because of line 53. So pt_thread_join, detach are never able do their work on threads that have runops-ed.

I don't think so: in line 47 the thread enters the runloop, state is JOINABLE (except when created detached). Another thread, which has the TID of the thread can now join or detach it. Only when the thread leaves its runloop, it's state is set to FINISHED. So at e.g. line 322

It's state is set to PREVIOUS_STATE+FINISHED So it's never equal to just FINISHED

src/threads.c: 53: interpreter->thread_data->state |= THREAD_STATE_FINISHED;
src/threads.c: 322: interpreter->thread_data->state == THREAD_STATE_FINISHED) {

Typo or what?




Reply via email to