[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCHv2 09/11] util: use VIR_DELETE_ELEMENTS_N for list of win32 waiting events



---
 src/util/threads-win32.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/util/threads-win32.c b/src/util/threads-win32.c
index 142aa4f..cfeb1a0 100644
--- a/src/util/threads-win32.c
+++ b/src/util/threads-win32.c
@@ -1,7 +1,7 @@
 /*
  * threads-win32.c: basic thread synchronization primitives
  *
- * Copyright (C) 2009-2011 Red Hat, Inc.
+ * Copyright (C) 2009-2012 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -200,14 +200,7 @@ void virCondSignal(virCondPtr c)
 
     if (c->nwaiters) {
         HANDLE event = c->waiters[0];
-        if (c->nwaiters > 1)
-            memmove(c->waiters,
-                    c->waiters + 1,
-                    sizeof(c->waiters[0]) * (c->nwaiters-1));
-        if (VIR_REALLOC_N(c->waiters, c->nwaiters - 1) < 0) {
-            ;
-        }
-        c->nwaiters--;
+        ignore_value(VIR_DELETE_ELEMENTS_N(c->waiters, 0, c->nwaiters, 1));
         SetEvent(event);
     }
 
-- 
1.7.11.7


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]