This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 5/6] nptl: Cleanup cancellation macros


On 28/12/18 6:32 AM, Adhemerval Zanella wrote:
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.

OK.

Siddhesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]