of VgTs_WaitJoiner) as non-existent for the purposes of cancellation.
This ensures that pthread_cancel returns ESRCH instead of trying to
cancel the thread, which would lead to the thread cleanup code being
run twice.
CCMAIL: 86730-done@bugs.kde.org
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2587
vg_assert(VG_(is_valid_tid)(tid));
vg_assert(VG_(threads)[tid].status == VgTs_Runnable);
- if (!VG_(is_valid_tid)(cee)) {
+ if (!VG_(is_valid_tid)(cee) ||
+ VG_(threads)[cee].status == VgTs_WaitJoiner) {
if (VG_(clo_trace_sched)) {
VG_(sprintf)(msg_buf,
"set_cancelpend for invalid tid %d", cee);