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

[libvirt] [PATCH 1/2] threads: Document spurious wakeups on virCondWait



---
 src/util/threads.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/util/threads.h b/src/util/threads.h
index b72610c..7d8a6ed 100644
--- a/src/util/threads.h
+++ b/src/util/threads.h
@@ -88,6 +88,11 @@ void virMutexUnlock(virMutexPtr m);
 int virCondInit(virCondPtr c) ATTRIBUTE_RETURN_CHECK;
 int virCondDestroy(virCondPtr c) ATTRIBUTE_RETURN_CHECK;
 
+/* virCondWait, virCondWaitUntil:
+ * These functions can return without associated predicate
+ * changing value. Therefore in nearly all cases there
+ * should be enclosed in a while loop that checks predicate.
+ */
 int virCondWait(virCondPtr c, virMutexPtr m) ATTRIBUTE_RETURN_CHECK;
 int virCondWaitUntil(virCondPtr c, virMutexPtr m, unsigned long long whenms) ATTRIBUTE_RETURN_CHECK;
 void virCondSignal(virCondPtr c);
-- 
1.7.3.4


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