Page MenuHomeFreeBSD

D60427.diff
No OneTemporary

D60427.diff

diff --git a/lib/libthr/thread/thr_umtx.h b/lib/libthr/thread/thr_umtx.h
--- a/lib/libthr/thread/thr_umtx.h
+++ b/lib/libthr/thread/thr_umtx.h
@@ -82,13 +82,19 @@
if (atomic_cmpset_acq_32(&mtx->m_owner, UMUTEX_UNOWNED, id))
return (0);
+ if ((uint32_t)mtx->m_owner == UMUTEX_CONTESTED &&
+ __predict_true((mtx->m_flags & (UMUTEX_PRIO_PROTECT |
+ UMUTEX_PRIO_INHERIT)) == 0) &&
+ atomic_cmpset_acq_32(&mtx->m_owner, UMUTEX_CONTESTED,
+ id | UMUTEX_CONTESTED))
+ return (0);
if (__predict_false((uint32_t)mtx->m_owner == UMUTEX_RB_OWNERDEAD) &&
atomic_cmpset_acq_32(&mtx->m_owner, UMUTEX_RB_OWNERDEAD,
id | UMUTEX_CONTESTED))
return (EOWNERDEAD);
if (__predict_false((uint32_t)mtx->m_owner == UMUTEX_RB_NOTRECOV))
return (ENOTRECOVERABLE);
- if ((mtx->m_flags & UMUTEX_PRIO_PROTECT) == 0)
+ if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0)
return (EBUSY);
return (__thr_umutex_trylock(mtx));
}

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 13, 3:45 PM (10 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40432097
Default Alt Text
D60427.diff (964 B)

Event Timeline