From d2dfc5de011fb525161b85a1408f716a2ea358cc Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 20 Jun 2000 00:34:21 +0000 Subject: Update. * iconv/gconv_int.h (strict gconv_module): Remove all members associated with regular expressions. Use a simple string as the from name. * iconv/gconv_db.c: Remove code handling regular expressions. * iconv/gconv_conf.c: Likewise. * iconv/iconv_prog.c: Likewise. * iconv/gconv_builtin.h: Adjust for change in gconv_conf.c. --- linuxthreads/sysdeps/pthread/timer_gettime.c | 35 ++++++++++++++++------------ 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'linuxthreads/sysdeps/pthread/timer_gettime.c') diff --git a/linuxthreads/sysdeps/pthread/timer_gettime.c b/linuxthreads/sysdeps/pthread/timer_gettime.c index 43b07598b7..dbee9d915e 100644 --- a/linuxthreads/sysdeps/pthread/timer_gettime.c +++ b/linuxthreads/sysdeps/pthread/timer_gettime.c @@ -31,25 +31,30 @@ timer_gettime (timerid, value) struct itimerspec *value; { struct timer_node *timer; - struct timespec now; - int retval = -1; + struct timespec now, expiry; + int retval = -1, armed = 0, valid; + clock_t clock = 0; pthread_mutex_lock (&__timer_mutex); timer = timer_id2ptr (timerid); - if (timer == NULL && !timer->inuse) - /* Invalid timer ID or the timer is not in use. */ - errno = EINVAL; - else - { - value->it_interval = timer->value.it_interval; + valid = timer_valid (timer); + + if (valid) { + armed = timer->armed; + expiry = timer->expirytime; + clock = timer->clock; + value->it_interval = timer->value.it_interval; + } + + pthread_mutex_unlock (&__timer_mutex); - if (timer->armed) + if (valid) + { + if (armed) { - pthread_mutex_unlock (&__timer_mutex); - clock_gettime (timer->clock, &now); - pthread_mutex_lock (&__timer_mutex); - timespec_sub (&value->it_value, &timer->expirytime, &now); + clock_gettime (clock, &now); + timespec_sub (&value->it_value, &expiry, &now); } else { @@ -59,8 +64,8 @@ timer_gettime (timerid, value) retval = 0; } - - pthread_mutex_lock (&__timer_mutex); + else + __set_errno (EINVAL); return retval; } -- cgit 1.4.1