Loading...
pthreads/pthread_cancelable.c Libc-763.11 Libc-825.25
--- Libc/Libc-763.11/pthreads/pthread_cancelable.c
+++ Libc/Libc-825.25/pthreads/pthread_cancelable.c
@@ -73,8 +73,13 @@
 			const struct timespec *abstime,
 			int isRelative,
 			int isconforming);
+extern int __sigwait(const sigset_t *set, int *sig);
+
+#ifdef VARIANT_CANCELABLE
 extern int __semwait_signal(int cond_sem, int mutex_sem, int timeout, int relative, __int64_t tv_sec, __int32_t tv_nsec);
-extern int __sigwait(const sigset_t *set, int *sig);
+#else
+extern int __semwait_signal(int cond_sem, int mutex_sem, int timeout, int relative, __int64_t tv_sec, __int32_t tv_nsec)  __asm__("___semwait_signal_nocancel");
+#endif
 
 /*
  * Wait for a thread to terminate and obtain its exit value.
@@ -284,6 +289,10 @@
 
 	if (__sigwait(set, sig) == -1) {
 		err = errno;
+
+#ifdef VARIANT_CANCELABLE
+		_pthread_testcancel(pthread_self(), 1);
+#endif /* VARIANT_CANCELABLE */
 		
 		/* 
 		 * EINTR that isn't a result of pthread_cancel()