diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-12-09 00:52:28 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-12-09 00:52:28 +0000 |
commit | 3f57a7735572a6d30f488e70c385e5b0275dbdc3 (patch) | |
tree | fad61db479c193db3b4ff289e1a2c1f92d41b6a6 | |
parent | b23168a4ae0a4f075c2d613ded671113256bba5e (diff) | |
download | FreeBSD-src-3f57a7735572a6d30f488e70c385e5b0275dbdc3.zip FreeBSD-src-3f57a7735572a6d30f488e70c385e5b0275dbdc3.tar.gz |
More reliably check timeout for pthread_mutex_timedlock.
-rw-r--r-- | lib/libkse/thread/thr_mutex.c | 2 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_mutex.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c index 017baeb..464bc39 100644 --- a/lib/libkse/thread/thr_mutex.c +++ b/lib/libkse/thread/thr_mutex.c @@ -752,7 +752,7 @@ mutex_lock_common(struct pthread *curthread, pthread_mutex_t *m, } while (((*m)->m_owner != curthread) && (ret == 0) && (curthread->interrupted == 0) && (curthread->timeout == 0)); - if (ret == 0 && curthread->timeout) + if (ret == 0 && (*m)->m_owner != curthread && curthread->timeout) ret = ETIMEDOUT; /* diff --git a/lib/libpthread/thread/thr_mutex.c b/lib/libpthread/thread/thr_mutex.c index 017baeb..464bc39 100644 --- a/lib/libpthread/thread/thr_mutex.c +++ b/lib/libpthread/thread/thr_mutex.c @@ -752,7 +752,7 @@ mutex_lock_common(struct pthread *curthread, pthread_mutex_t *m, } while (((*m)->m_owner != curthread) && (ret == 0) && (curthread->interrupted == 0) && (curthread->timeout == 0)); - if (ret == 0 && curthread->timeout) + if (ret == 0 && (*m)->m_owner != curthread && curthread->timeout) ret = ETIMEDOUT; /* |