Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156693738
D27947.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
689 B
Referenced Files
None
Subscribers
None
D27947.diff
View Options
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -984,17 +984,19 @@
op = flags & LK_TYPE_MASK;
v = lockmgr_read_value(lk);
for (;;) {
- if (LK_SHARERS_LOCK(v) > 1) {
+ if (LK_SHARERS(v) > 1) {
if (op == LK_TRYUPGRADE) {
LOCK_LOG2(lk, "%s: %p failed the nowait upgrade",
__func__, lk);
error = EBUSY;
goto out;
}
- if (lockmgr_sunlock_try(lk, &v)) {
+ if (atomic_fcmpset_rel_ptr(&lk->lk_lock, &v,
+ v - LK_ONE_SHARER)) {
lockmgr_note_shared_release(lk, file, line);
goto out_xlock;
}
+ continue;
}
MPASS((v & ~LK_ALL_WAITERS) == LK_SHARERS_LOCK(1));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 5:49 PM (3 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33142291
Default Alt Text
D27947.diff (689 B)
Attached To
Mode
D27947: Fix LK_TRYUPGRADE
Attached
Detach File
Event Timeline
Log In to Comment