[Libvir] PATCH: Fix and cleanup ref counting/ domain/network object release

Richard W.M. Jones rjones at redhat.com
Mon Jan 21 14:57:37 UTC 2008


Daniel P. Berrange wrote:

> The problem is that we need to use pthread_t / pthread_create APIs for
> other parts of libvirt. libxml2 doesn't provide any portability layer
> for threads - only for mutexes. Any platform which has pthread_t, already
> has pthread_mutex_t, so although in theory the pthread_mutex_t is less
> portable than xmlMutex, in practice the overall portability is the same
> due to the constraint of needing pthread_t.

Don't be forgetting about Windows.  MinGW has a pthread API, and Red Hat 
also have one[1].  Whether they are the same or not I haven't found out yet.

The one thing I noticed is you need to be careful about pthread_t : on 
Unix this is usually an int of some sort, but on Windows it's a 
structure.  You might also want to check [2] for some gotchas, 
particularly around thread cancellation.

Rich.

[1] http://sources.redhat.com/pthreads-win32/
[2] http://sources.redhat.com/pthreads-win32/faq.html

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080121/4d022935/attachment-0001.bin>


More information about the libvir-list mailing list