virThread: why no return values permitted in thread API?

Daniel P. Berrangé berrange at redhat.com
Wed Apr 20 12:50:31 UTC 2022


On Wed, Apr 20, 2022 at 02:24:39PM +0200, Claudio Fontana wrote:
> Hi,
> 
> I noticed that in the virThread API return values from threads are explicitly excluded from the API.
> 
> The "virThreadHelper" sits in the middle between the caller of
> virThreadCreate and pthread, making it impossible to return a
> value from the thread, to check after joining the thread.

Mostly a historical artifact from when we had a native impl of
threads for Win32. We didn't need that ability, so I never
bothered to try to figure it out for Win32  and thus for
consistency I left it out of POSIX impl too.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


More information about the libvir-list mailing list