From: Tom Hughes Date: Fri, 29 Oct 2004 18:36:17 +0000 (+0000) Subject: When a thread is cancelled only abort pending system calls if X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cfe9a052bf39da30ca62330ab335ca47f2d7c40;p=thirdparty%2Fvalgrind.git When a thread is cancelled only abort pending system calls if the thread is set for asynchronous cancellation and cancellation is enabled. This fixes a long standing occasional failure in the pth_cancel2 test. MERGE TO STABLE git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_2_2_0_BRANCH@2878 --- diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index a42f6dcb29..12429cee51 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -1749,8 +1749,11 @@ void do__set_cancelpend ( ThreadId tid, VG_(threads)[cee].cancel_pend = cancelpend_hdlr; - /* interrupt a pending syscall */ - VG_(proxy_abort_syscall)(cee); + /* interrupt a pending syscall if asynchronous cancellation + is enabled for the target thread */ + if (VG_(threads)[cee].cancel_st && !VG_(threads)[cee].cancel_ty) { + VG_(proxy_abort_syscall)(cee); + } if (VG_(clo_trace_sched)) { VG_(sprintf)(msg_buf,