[libvirt] [PATCH] threads: add virThreadID for debugging use
Eric Blake
eblake at redhat.com
Mon Dec 6 16:50:30 UTC 2010
On 12/05/2010 11:58 AM, Matthias Bolte wrote:
> 2010/12/4 Eric Blake <eblake at redhat.com>:
>> * src/util/threads.h (virThreadID): New prototype.
>> * src/util/threads-pthread.c (virThreadID): New function.
>> * src/util/threads-win32.c (virThreadID): Likewise.
>> * src/libvirt_private.syms (threads.h): Export it.
>> * daemon/event.c (virEventInterruptLocked): Use it to avoid
>> warning on BSD systems.
>> ---
>
>> +
>> +/* These next two functions are for debugging only, since they are not
>> + * guaranteed to give unique values for distinct threads on all
>> + * architectures. */
>> int virThreadSelfID(void);
>> +int virThreadID(virThreadPtr thread);
>>
>
> This solve the problem, but it should also be noted that
> virThreadSelfID and virThreadID cannot be used for comparison as they
> are not taken from the same source.
>
> ACK.
Thanks for the review; I'm updating the comment to this, then pushing:
/* These next two functions are for debugging only, since they are not
* guaranteed to give unique values for distinct threads on all
* architectures, nor are the two functions guaranteed to give the same
* value for the same thread. */
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101206/dfe069b9/attachment-0001.sig>
More information about the libvir-list
mailing list