[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] rfifolock: no need to get thread identifier when ne
From: |
Changlong Xie |
Subject: |
[Qemu-devel] [PATCH] rfifolock: no need to get thread identifier when nesting |
Date: |
Tue, 10 May 2016 17:16:33 +0800 |
Signed-off-by: Changlong Xie <address@hidden>
---
util/rfifolock.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/util/rfifolock.c b/util/rfifolock.c
index c22f5fe..f406cc1 100644
--- a/util/rfifolock.c
+++ b/util/rfifolock.c
@@ -50,6 +50,7 @@ void rfifolock_lock(RFifoLock *r)
if (r->nesting > 0 && qemu_thread_is_self(&r->owner_thread)) {
r->tail--; /* put ticket back, we're nesting */
+ goto out;
} else {
while (ticket != r->head) {
/* Invoke optional contention callback */
@@ -61,6 +62,7 @@ void rfifolock_lock(RFifoLock *r)
}
qemu_thread_get_self(&r->owner_thread);
+out:
r->nesting++;
qemu_mutex_unlock(&r->lock);
}
--
1.9.3
- [Qemu-devel] [PATCH] rfifolock: no need to get thread identifier when nesting,
Changlong Xie <=