]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When a thread is cancelled only abort pending system calls if
authorTom Hughes <tom@compton.nu>
Fri, 29 Oct 2004 18:36:17 +0000 (18:36 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 29 Oct 2004 18:36:17 +0000 (18:36 +0000)
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

coregrind/vg_scheduler.c

index a42f6dcb29de417982a22e4b47341be3904f074b..12429cee51421cb33f13d7a3daeaea91ee609c82 100644 (file)
@@ -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,