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

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

 



---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]