From 53bfe35486b304ce77695040ccf8294dae36d45f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 3 Dec 2004 11:20:54 +0000 Subject: * posix/tst-regex.c: Use defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 conditionals instead of defined _POSIX_CPUTIME. (main): If _POSIX_CPUTIME == 0, call sysconf to see if CPUTIME option is available. * posix/tst-regex.c2: Use defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 conditionals instead of defined _POSIX_CPUTIME. (do_test): If _POSIX_CPUTIME == 0, call sysconf to see if CPUTIME option is available. * sysdeps/posix/sysconf.c (__sysconf): If _POSIX_CPUTIME resp. _POSIX_THREAD_CPUTIME is defined to 0, return -1 for the corresponding _SC_ argument. nptl/ * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME, _POSIX_THREAD_CPUTIME): Define to 0. * sysdeps/pthread/timer_create.c (timer_create): Remove unused code handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID. * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. (init_module): Remove their initialization. (thread_cleanup): Remove their cleanup assertions. * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed. linuxthreads/ * sysdeps/unix/sysv/linux/bits/posix_opt.h (_POSIX_CPUTIME, _POSIX_THREAD_CPUTIME): Define to 0. * sysdeps/pthread/timer_create.c (timer_create): Remove unused code handling CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID. * sysdeps/pthread/timer_routines.c (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. (init_module): Remove their initialization. (thread_cleanup): Remove their cleanup assertions. * sysdeps/pthread/posix-timer.h (__timer_signal_thread_pclk, __timer_signal_thread_tclk): Remove. * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Removed. * sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Removed. --- nptl/sysdeps/pthread/posix-timer.h | 10 +--------- nptl/sysdeps/pthread/timer_create.c | 19 +------------------ nptl/sysdeps/pthread/timer_routines.c | 18 ------------------ 3 files changed, 2 insertions(+), 45 deletions(-) (limited to 'nptl/sysdeps/pthread') diff --git a/nptl/sysdeps/pthread/posix-timer.h b/nptl/sysdeps/pthread/posix-timer.h index 843e44711a..8b4cbc8cdf 100644 --- a/nptl/sysdeps/pthread/posix-timer.h +++ b/nptl/sysdeps/pthread/posix-timer.h @@ -88,16 +88,8 @@ extern pthread_once_t __timer_init_once_control; /* Nonzero if initialization of timer implementation failed. */ extern int __timer_init_failed; -/* Nodes for the threads used to deliver signals. */ -/* A distinct thread is used for each clock type. */ - +/* Node for the thread used to deliver signals. */ extern struct thread_node __timer_signal_thread_rclk; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 -extern struct thread_node __timer_signal_thread_pclk; -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 -extern struct thread_node __timer_signal_thread_tclk; -#endif /* Return pointer to timer structure corresponding to ID. */ diff --git a/nptl/sysdeps/pthread/timer_create.c b/nptl/sysdeps/pthread/timer_create.c index 2f5a587e8d..2809ac7443 100644 --- a/nptl/sysdeps/pthread/timer_create.c +++ b/nptl/sysdeps/pthread/timer_create.c @@ -94,24 +94,7 @@ timer_create (clock_id, evp, timerid) case SIGEV_SIGNAL: /* We have a global thread for delivering timed signals. If it is not running, try to start it up. */ - switch (clock_id) - { - case CLOCK_REALTIME: - default: - thread = &__timer_signal_thread_rclk; - break; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 - case CLOCK_PROCESS_CPUTIME_ID: - thread = &__timer_signal_thread_pclk; - break; -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 - case CLOCK_THREAD_CPUTIME_ID: - thread = &__timer_signal_thread_tclk; - break; -#endif - } - + thread = &__timer_signal_thread_rclk; if (! thread->exists) { if (__builtin_expect (__timer_thread_start (thread), diff --git a/nptl/sysdeps/pthread/timer_routines.c b/nptl/sysdeps/pthread/timer_routines.c index caa93433e3..8d5b1d13a5 100644 --- a/nptl/sysdeps/pthread/timer_routines.c +++ b/nptl/sysdeps/pthread/timer_routines.c @@ -53,12 +53,6 @@ int __timer_init_failed; /* Node for the thread used to deliver signals. */ struct thread_node __timer_signal_thread_rclk; -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 -struct thread_node __timer_signal_thread_pclk; -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 -struct thread_node __timer_signal_thread_tclk; -#endif /* Lists to keep free and used timers and threads. */ struct list_links timer_free_list; @@ -191,12 +185,6 @@ init_module (void) list_append (&thread_free_list, &thread_array[i].links); thread_init (&__timer_signal_thread_rclk, 0, CLOCK_REALTIME); -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 - thread_init (&__timer_signal_thread_pclk, 0, CLOCK_PROCESS_CPUTIME_ID); -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 - thread_init (&__timer_signal_thread_tclk, 0, CLOCK_THREAD_CPUTIME_ID); -#endif } @@ -281,12 +269,6 @@ thread_cleanup (void *val) /* How did the signal thread get killed? */ assert (thread != &__timer_signal_thread_rclk); -#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 - assert (thread != &__timer_signal_thread_pclk); -#endif -#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0 - assert (thread != &__timer_signal_thread_tclk); -#endif pthread_mutex_lock (&__timer_mutex); -- cgit 1.4.1