Fix for GitHub issue #165 : assertion failure on thread join.
If a thread becomes detached due to a join_any statement, that thread must not attempt to join its parent, even if the parent is waiting on a subsequent join statement.
This commit is contained in:
parent
85fa24fa58
commit
e315cafa01
|
|
@ -2738,7 +2738,7 @@ bool of_END(vthread_t thr, vvp_code_t)
|
||||||
/* If I have a parent who is waiting for me, then mark that I
|
/* If I have a parent who is waiting for me, then mark that I
|
||||||
have ended, and schedule that parent. Also, finish the
|
have ended, and schedule that parent. Also, finish the
|
||||||
%join for the parent. */
|
%join for the parent. */
|
||||||
if (thr->parent && thr->parent->i_am_joining) {
|
if (!thr->i_am_detached && thr->parent && thr->parent->i_am_joining) {
|
||||||
vthread_t tmp = thr->parent;
|
vthread_t tmp = thr->parent;
|
||||||
assert(! thr->i_am_detached);
|
assert(! thr->i_am_detached);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue