On 05/10/2016 12:16 PM, Changlong Xie wrote:
Signed-off-by: Changlong Xie <[email protected]>
---
  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);
  }
it would be better to put
    qemu_thread_get_self(&r->owner_thread);
2 lines up and avoid unnecessary goto

Reply via email to