More reliably check timeout for pthread_mutex_timedlock.
This commit is contained in:
parent
e59192102a
commit
1d5e4bd687
@ -752,7 +752,7 @@ mutex_lock_common(struct pthread *curthread, pthread_mutex_t *m,
|
|||||||
} while (((*m)->m_owner != curthread) && (ret == 0) &&
|
} while (((*m)->m_owner != curthread) && (ret == 0) &&
|
||||||
(curthread->interrupted == 0) && (curthread->timeout == 0));
|
(curthread->interrupted == 0) && (curthread->timeout == 0));
|
||||||
|
|
||||||
if (ret == 0 && curthread->timeout)
|
if (ret == 0 && (*m)->m_owner != curthread && curthread->timeout)
|
||||||
ret = ETIMEDOUT;
|
ret = ETIMEDOUT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -752,7 +752,7 @@ mutex_lock_common(struct pthread *curthread, pthread_mutex_t *m,
|
|||||||
} while (((*m)->m_owner != curthread) && (ret == 0) &&
|
} while (((*m)->m_owner != curthread) && (ret == 0) &&
|
||||||
(curthread->interrupted == 0) && (curthread->timeout == 0));
|
(curthread->interrupted == 0) && (curthread->timeout == 0));
|
||||||
|
|
||||||
if (ret == 0 && curthread->timeout)
|
if (ret == 0 && (*m)->m_owner != curthread && curthread->timeout)
|
||||||
ret = ETIMEDOUT;
|
ret = ETIMEDOUT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user