From ad0b866780adf56e19114fb67ab2d532b4501425 Mon Sep 17 00:00:00 2001 From: rpj Date: Thu, 25 Mar 1999 19:27:49 +0000 Subject: Fri Mar 26 14:11:45 1999 Ross Johnson * semaphore.c (_pthread_sem_timedwait): Check for negative milliseconds. - Tor Lillqvist --- ChangeLog | 10 ++++++++++ semaphore.c | 3 +++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 90c032c..b51027b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,23 @@ +Fri Mar 26 14:11:45 1999 Ross Johnson + + * semaphore.c (_pthread_sem_timedwait): Check for negative + milliseconds. + - Tor Lillqvist + Wed Mar 24 11:32:07 1999 Ross Johnson * misc.c (CancelableWait): Initialise exceptionInformation[2]. (pthread_self): Get a real Win32 thread handle for implicit threads. + - John Bossom * cancel.c (pthread_testcancel): Initialise exceptionInformation[2]. + - John Bossom * implement.h (SE_INFORMATION): Fix values. + - John Bossom * private.c (_pthread_threadDestroy): Close the thread handle. + - John Bossom Fri Mar 19 12:57:27 1999 Ross Johnson diff --git a/semaphore.c b/semaphore.c index 4cb0a80..0d46614 100644 --- a/semaphore.c +++ b/semaphore.c @@ -307,6 +307,9 @@ _pthread_sem_timedwait (_pthread_sem_t * sem, const struct timespec * abstime) milliseconds = (abstime->tv_sec - currSysTime.time) * MILLISEC_PER_SEC; milliseconds += (abstime->tv_nsec / NANOSEC_PER_MILLISEC) - currSysTime.millitm; + + if (((int) milliseconds) < 0) + milliseconds = 0; } return (pthreadCancelableTimedWait (*sem, milliseconds)); -- cgit v1.2.3