glibc/sysdeps/nptl
Adhemerval Zanella ce7eb0e903 nptl: Cleanup cancellation macros
This patch wraps all uses of *_{enable,disable}_asynccancel and
and *_CANCEL_{ASYNC,RESET} in either already provided macros
(lll_futex_timed_wait_cancel) or creates new ones if the
functionality is not provided (SYSCALL_CANCEL_NCS, lll_futex_wait_cancel,
and lll_futex_timed_wait_cancel).

Also for some generic implementations, the direct call of the macros
are removed since the underlying symbols are suppose to provide
cancellation support.

This is a priliminary patch intended to simplify the work required
for BZ#12683 fix.  It is a refactor change, no semantic changes are
expected.

Checked on x86_64-linux-gnu and i686-linux-gnu.

	* nptl/pthread_join_common.c (__pthread_timedjoin_ex): Use
	lll_wait_tid with timeout.
	* nptl/sem_wait.c (__old_sem_wait): Use lll_futex_wait_cancel.
	* sysdeps/nptl/aio_misc.h (AIO_MISC_WAIT): Use
	futex_reltimed_wait_cancelable for cancelabla mode.
	* sysdeps/nptl/gai_misc.h (GAI_MISC_WAIT): Likewise.
	* sysdeps/posix/open64.c (__libc_open64): Do not call cancelation
	macros.
	* sysdeps/posix/sigwait.c (__sigwait): Likewise.
	* sysdeps/posix/waitid.c (__sigwait): Likewise.
	* sysdeps/unix/sysdep.h (__SYSCALL_CANCEL_CALL,
	SYSCALL_CANCEL_NCS): New macro.
	* sysdeps/nptl/lowlevellock.h (lll_wait_tid): Add timeout argument.
	(lll_timedwait_tid): Remove macro.
	* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_wait_tid):
	Likewise.
	(lll_timedwait_tid): Likewise.
	* sysdeps/unix/sysv/linux/sparc/lowlevellock.h (lll_wait_tid):
	Likewise.
	(lll_timedwait_tid): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (lll_wait_tid):
	Likewise.
	(lll_timedwait_tid): Likewise.
	* sysdeps/unix/sysv/linux/clock_nanosleep.c (__clock_nanosleep):
	Use INTERNAL_SYSCALL_CANCEL.
	* sysdeps/unix/sysv/linux/futex-internal.h
	(futex_reltimed_wait_cancelable): Use LIBC_CANCEL_{ASYNC,RESET}
	instead of __pthread_{enable,disable}_asynccancel.
	* sysdeps/unix/sysv/linux/lowlevellock-futex.h
	(lll_futex_wait_cancel): New macro.
2019-01-03 18:38:16 -02:00
..
bits Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
sys Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
Implies Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
Makeconfig Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
Subdirs Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
aio_misc.h nptl: Cleanup cancellation macros 2019-01-03 18:38:16 -02:00
allocrtsig.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
dl-tunables.list Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fork.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fork.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
futex-internal.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
gai_misc.h nptl: Cleanup cancellation macros 2019-01-03 18:38:16 -02:00
internaltypes.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
jmp-unwind.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
libc-lock.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
libc-lockP.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
librt-cancellation.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
lowlevellock-futex.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
lowlevellock.h nptl: Cleanup cancellation macros 2019-01-03 18:38:16 -02:00
malloc-machine.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
pthread-functions.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
pthread.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
setxid.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
shm-directory.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
stdio-lock.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tcb-offsets.h Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
threads.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
timer_routines.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-mqueue8x.c Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
unwind-forcedunwind.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00