Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178210547
D62266.1796262759.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
540 B
Referenced Files
None
Subscribers
None
D62266.1796262759.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D62266: libthr: Speedup spinlock unlock
Attached
Detach File
Event Timeline