Date: Mon, 17 Mar 2014 02:10:45 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r263255 - stable/9/lib/libc/gen Message-ID: <201403170210.s2H2Aj6n088122@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidxu Date: Mon Mar 17 02:10:45 2014 New Revision: 263255 URL: http://svnweb.freebsd.org/changeset/base/263255 Log: MFC r263107: To avoid missing a chance to cancel thread, call _pthread_testcancel at the beginning of _sem_timedwait. Submitted by: Eric van Gyzen < eric at vangyzen dot net > Modified: stable/9/lib/libc/gen/sem_new.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/sem_new.c ============================================================================== --- stable/9/lib/libc/gen/sem_new.c Sun Mar 16 22:56:22 2014 (r263254) +++ stable/9/lib/libc/gen/sem_new.c Mon Mar 17 02:10:45 2014 (r263255) @@ -393,6 +393,7 @@ _sem_timedwait(sem_t * __restrict sem, return (-1); retval = 0; + _pthread_testcancel(); for (;;) { while ((val = sem->_kern._count) > 0) { if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403170210.s2H2Aj6n088122>