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:
Martin Whitaker 2017-10-07 16:41:26 +01:00
parent 85fa24fa58
commit e315cafa01
1 changed files with 1 additions and 1 deletions

View File

@ -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
have ended, and schedule that parent. Also, finish the
%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;
assert(! thr->i_am_detached);