2002-04-08  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/pthread/timer_getoverr.c: Return real overrun.
	* sysdeps/pthread/posix-timer.h (struct timer_node): Add overrun_count.
	* sysdeps/pthread/timer_routines.c (thread_func): Schedule next timeout
	based on previous one and not on current time.  Count overruns.
	Patch by Eric F. Sorton <eric@cctcorp.com>.

	* sysdeps/unix/sysv/linux/bits/local_lim.h: Add DELAYTIMER_MAX.

	(FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Defined.
This commit is contained in:
Ulrich Drepper 2002-04-09 02:10:21 +00:00
parent 776cc5d31c
commit 14b2ede5b2
5 changed files with 26 additions and 8 deletions

View file

@ -1,8 +1,18 @@
2002-04-08 Ulrich Drepper <drepper@redhat.com>
* sysdeps/pthread/timer_getoverr.c: Return real overrun.
* sysdeps/pthread/posix-timer.h (struct timer_node): Add overrun_count.
* sysdeps/pthread/timer_routines.c (thread_func): Schedule next timeout
based on previous one and not on current time. Count overruns.
Patch by Eric F. Sorton <eric@cctcorp.com>.
* sysdeps/unix/sysv/linux/bits/local_lim.h: Add DELAYTIMER_MAX.
2002-04-08 kaz Kojima <kkojima@rr.iij4u.or.jp> 2002-04-08 kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H * sysdeps/sh/pt-machine.h: Define _PT_MACHINE_H
if it isn't defined yet. if it isn't defined yet.
(FLOATING_STACKS, EARCH_STACK_MAX_SIZE): Defined. (FLOATING_STACKS, ARCH_STACK_MAX_SIZE): Defined.
(THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC): (THREAD_GETMEM, THREAD_GETMEM_NC, THREAD_SETMEM, THREAD_SETMEM_NC):
Likewise. Likewise.
* sysdeps/sh/tls.h: New file. * sysdeps/sh/tls.h: New file.

View file

@ -1,5 +1,5 @@
/* Definitions for POSIX timer implementation on top of LinuxThreads. /* Definitions for POSIX timer implementation on top of LinuxThreads.
Copyright (C) 2000 Free Software Foundation, Inc. Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>. Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@ -65,6 +65,7 @@ struct timer_node
struct thread_node *thread; struct thread_node *thread;
pid_t creator_pid; pid_t creator_pid;
int refcount; int refcount;
int overrun_count;
}; };

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2000, 2001 Free Software Foundation, Inc. /* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>. Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@ -37,7 +37,7 @@ timer_getoverrun (timerid)
if (! timer_valid (timer = timer_id2ptr (timerid))) if (! timer_valid (timer = timer_id2ptr (timerid)))
__set_errno (EINVAL); __set_errno (EINVAL);
else else
retval = 0; /* TODO: overrun counting not supported */ retval = timer->overrun_count;
pthread_mutex_unlock (&__timer_mutex); pthread_mutex_unlock (&__timer_mutex);

View file

@ -1,5 +1,5 @@
/* Helper code for POSIX timer implementation on LinuxThreads. /* Helper code for POSIX timer implementation on LinuxThreads.
Copyright (C) 2000, 2001 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>. Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@ -413,8 +413,16 @@ thread_func (void *arg)
if (__builtin_expect (timer->value.it_interval.tv_sec, 0) != 0 if (__builtin_expect (timer->value.it_interval.tv_sec, 0) != 0
|| timer->value.it_interval.tv_nsec != 0) || timer->value.it_interval.tv_nsec != 0)
{ {
timespec_add (&timer->expirytime, &now, timer->overrun_count = 0;
timespec_add (&timer->expirytime, &timer->expirytime,
&timer->value.it_interval); &timer->value.it_interval);
while (timespec_compare(&timer->expirytime, &now) < 0)
{
timespec_add (&timer->expirytime, &timer->expirytime,
&timer->value.it_interval);
if (timer->overrun_count < DELAYTIMER_MAX)
++timer->overrun_count;
}
__timer_thread_queue_timer (self, timer); __timer_thread_queue_timer (self, timer);
} }

View file

@ -26,5 +26,4 @@ typedef struct
} tls_index; } tls_index;
extern void *__tls_get_addr (tls_index *ti) extern void *__tls_get_addr (tls_index *ti);
__attribute__ ((__regparm__ (1)));