p4-projects@freebsd.org
[Top] [All Lists]

PERFORCE change 73586 for review

Subject: PERFORCE change 73586 for review
From: David Xu
Date: Sun, 20 Mar 2005 13:51:29 GMT
http://perforce.freebsd.org/chv.cgi?CH=73586

Change 73586 by davidxu@davidxu_alona on 2005/03/20 13:50:40

        Check timeout.

Affected files ...

.. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_umtx.c#3 edit

Differences ...

==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_umtx.c#3 
(text+ko) ====

@@ -42,6 +42,9 @@
 __thr_umtx_timedlock(volatile umtx_t *mtx, long id,
        const struct timespec *timeout)
 {
+       if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 &&
+               timeout->tv_nsec <= 0)))
+               return (ETIMEDOUT);
        if (_umtx_op((struct umtx *)mtx, UMTX_OP_LOCK, id, 0,
                (void *)timeout) == 0)
                return (0);
@@ -59,6 +62,9 @@
 int
 _thr_umtx_wait(volatile umtx_t *mtx, long id, const struct timespec *timeout)
 {
+       if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 &&
+               timeout->tv_nsec <= 0)))
+               return (ETIMEDOUT);
        if (_umtx_op((struct umtx *)mtx, UMTX_OP_WAIT, id, 0,
                (void*) timeout) == 0)
                return (0);
_______________________________________________
p4-projects@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "p4-projects-unsubscribe@xxxxxxxxxxx"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 73586 for review, David Xu <=