Page MenuHomeFreeBSD

D62266.1796262759.diff
No OneTemporary

Authored By
Unknown
Size
540 B
Referenced Files
None
Subscribers
None

D62266.1796262759.diff

diff --git a/lib/libthr/thread/thr_pspinlock.c b/lib/libthr/thread/thr_pspinlock.c
--- a/lib/libthr/thread/thr_pspinlock.c
+++ b/lib/libthr/thread/thr_pspinlock.c
@@ -149,5 +149,9 @@
lck = *lock == THR_PSHARED_PTR ? __thr_pshared_offpage(lock, 0) : *lock;
if (lck == NULL)
return (EINVAL);
- return (THR_UMUTEX_UNLOCK(_get_curthread(), &lck->s_lock));
+ if (__predict_false(
+ (uint32_t)lck->s_lock.m_owner != TID(_get_curthread())))
+ return (EPERM);
+ atomic_store_rel_32(&lck->s_lock.m_owner, UMUTEX_UNOWNED);
+ return (0);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 3, 1:52 AM (18 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42137970
Default Alt Text
D62266.1796262759.diff (540 B)

Event Timeline