(fix commits
62097c3,
59e2bcf)
* pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread):
Do not call RAISE_SIGNAL() and sem_wait() if thread has FINISHED flag
set; do not handle ESRCH error result of RAISE_SIGNAL(); add comment.
(void)GC_do_blocking(suspend_self_inner, t);
return;
}
+ if ((t -> flags & FINISHED) != 0) {
+ /* Terminated but not joined yet. */
+ UNLOCK();
+ return;
+ }
/* TODO: Support GC_retry_signals */
switch (RAISE_SIGNAL(t, GC_sig_suspend)) {
- case ESRCH:
- /* Not really there anymore (terminated but not joined yet). */
- /* No need to wait but leave the suspension flag on. */
- GC_ASSERT((t -> flags & FINISHED) != 0);
- UNLOCK();
- return;
+ /* ESRCH cannot happen as terminated threads are handled above. */
case 0:
break;
default: