/* XXX Care about exceptions? */
(void) lock_monitor_exit(jlt.get_handle());
+ t->waitmutex->lock();
+ t->tid = 0;
+ t->waitmutex->unlock();
+
/* Enter the join-mutex before calling thread_free, so
threads_join_all_threads gets the correct number of non-daemon
threads. */
cond_join->signal();
threads_mutex_join_unlock();
+ t->suspendmutex->lock();
+ t->suspendmutex->unlock();
+
return true;
}
}
else {
// Send the suspend signal to the other thread.
+ if (!thread->tid)
+ return false;
if (pthread_kill(thread->tid, SIGUSR1) != 0)
os::abort_errno("threads_suspend_thread: pthread_kill failed");
/* Interrupt blocking system call using a signal. */
- pthread_kill(t->tid, Signal_INTERRUPT_SYSTEM_CALL);
+ if (t->tid)
+ pthread_kill(t->tid, Signal_INTERRUPT_SYSTEM_CALL);
t->waitcond->signal();