mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Add single-thread.h header
This patch move the single-thread syscall optimization defintions from syscall-cancel.h to new header file single-thread.h and also move the cancellation definitions from pthreadP.h to syscall-cancel.h. The idea is just simplify the inclusion of both syscall-cancel.h and single-thread.h (without the requirement of including all pthreadP.h defintions). No semantic changes expected, checked on a build for all major ABIs. * nptl/pthreadP.h (CANCEL_ASYNC, CANCEL_RESET, LIBC_CANCEL_ASYNC, LIBC_CANCEL_RESET, __libc_enable_asynccancel, __libc_disable_asynccancel, __librt_enable_asynccancel, __libc_disable_asynccancel, __librt_enable_asynccancel, __librt_disable_asynccancel): Move to ... * sysdeps/unix/sysv/linux/sysdep-cancel.h: ... here. (SINGLE_THREAD_P, RTLD_SINGLE_THREAD_P): Move to ... * sysdeps/unix/sysv/linux/single-thread.h: ... here. * sysdeps/generic/single-thread.h: New file. * sysdeps/unix/sysdep.h: Include single-thread.h. * sysdeps/unix/sysv/linux/futex-internal.h: Include sysdep-cancel.h. * sysdeps/unix/sysv/linux/lowlevellock-futex.h: Likewise.
This commit is contained in:
@ -311,34 +311,6 @@ __do_cancel (void)
|
||||
}
|
||||
|
||||
|
||||
/* Set cancellation mode to asynchronous. */
|
||||
#define CANCEL_ASYNC() \
|
||||
__pthread_enable_asynccancel ()
|
||||
/* Reset to previous cancellation mode. */
|
||||
#define CANCEL_RESET(oldtype) \
|
||||
__pthread_disable_asynccancel (oldtype)
|
||||
|
||||
#if IS_IN (libc)
|
||||
/* Same as CANCEL_ASYNC, but for use in libc.so. */
|
||||
# define LIBC_CANCEL_ASYNC() \
|
||||
__libc_enable_asynccancel ()
|
||||
/* Same as CANCEL_RESET, but for use in libc.so. */
|
||||
# define LIBC_CANCEL_RESET(oldtype) \
|
||||
__libc_disable_asynccancel (oldtype)
|
||||
#elif IS_IN (libpthread)
|
||||
# define LIBC_CANCEL_ASYNC() CANCEL_ASYNC ()
|
||||
# define LIBC_CANCEL_RESET(val) CANCEL_RESET (val)
|
||||
#elif IS_IN (librt)
|
||||
# define LIBC_CANCEL_ASYNC() \
|
||||
__librt_enable_asynccancel ()
|
||||
# define LIBC_CANCEL_RESET(val) \
|
||||
__librt_disable_asynccancel (val)
|
||||
#else
|
||||
# define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */
|
||||
# define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Internal prototypes. */
|
||||
|
||||
/* Thread list handling. */
|
||||
@ -535,15 +507,6 @@ extern int __pthread_cond_wait_2_0 (pthread_cond_2_0_t *cond,
|
||||
extern int __pthread_getaffinity_np (pthread_t th, size_t cpusetsize,
|
||||
cpu_set_t *cpuset);
|
||||
|
||||
/* The two functions are in libc.so and not exported. */
|
||||
extern int __libc_enable_asynccancel (void) attribute_hidden;
|
||||
extern void __libc_disable_asynccancel (int oldtype) attribute_hidden;
|
||||
|
||||
|
||||
/* The two functions are in librt.so and not exported. */
|
||||
extern int __librt_enable_asynccancel (void) attribute_hidden;
|
||||
extern void __librt_disable_asynccancel (int oldtype) attribute_hidden;
|
||||
|
||||
#if IS_IN (libpthread)
|
||||
/* Special versions which use non-exported functions. */
|
||||
extern void __pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
|
||||
|
Reference in New Issue
Block a user