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

Eric Blake eblake at redhat.com
Fri Dec 9 16:45:11 UTC 2011


On 12/09/2011 09:29 AM, Michal Privoznik wrote:
> ---
>  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

s/without/without the/

> + * changing value. Therefore in nearly all cases there

s/there/they/

> + * should be enclosed in a while loop that checks predicate.

s/checks/checks the/

> + */
>  int virCondWait(virCondPtr c, virMutexPtr m) ATTRIBUTE_RETURN_CHECK;
>  int virCondWaitUntil(virCondPtr c, virMutexPtr m, unsigned long long whenms) ATTRIBUTE_RETURN_CHECK;

I'd also insert a newline here, to make it obvious that the above docs
apply just to the two Wait functions, and not also the Signal function.

>  void virCondSignal(virCondPtr c);

ACK with nits fixed.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111209/3a731a47/attachment-0001.sig>


More information about the libvir-list mailing list