summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpj <rpj>1999-03-25 19:27:49 +0000
committerrpj <rpj>1999-03-25 19:27:49 +0000
commitad0b866780adf56e19114fb67ab2d532b4501425 (patch)
tree86466a586b6d5cd11e4086b8ca25dc0a5da58444
parentab9f05fd540b3eff6456f886edda87cb95bfbadc (diff)
Fri Mar 26 14:11:45 1999 Ross Johnson <rpj@swan.canberra.edu.au>
* semaphore.c (_pthread_sem_timedwait): Check for negative milliseconds. - Tor Lillqvist <tml@iki.fi>
-rw-r--r--ChangeLog10
-rw-r--r--semaphore.c3
2 files changed, 13 insertions, 0 deletions
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 <rpj@swan.canberra.edu.au>
+
+ * semaphore.c (_pthread_sem_timedwait): Check for negative
+ milliseconds.
+ - Tor Lillqvist <tml@iki.fi>
+
Wed Mar 24 11:32:07 1999 Ross Johnson <rpj@swan.canberra.edu.au>
* misc.c (CancelableWait): Initialise exceptionInformation[2].
(pthread_self): Get a real Win32 thread handle for implicit threads.
+ - John Bossom <jebossom@cognos.com>
* cancel.c (pthread_testcancel): Initialise exceptionInformation[2].
+ - John Bossom <jebossom@cognos.com>
* implement.h (SE_INFORMATION): Fix values.
+ - John Bossom <jebossom@cognos.com>
* private.c (_pthread_threadDestroy): Close the thread handle.
+ - John Bossom <jebossom@cognos.com>
Fri Mar 19 12:57:27 1999 Ross Johnson <rpj@swan.canberra.edu.au>
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));