On Tue, Feb 06, 2024 at 05:15:07PM +0800, Peter Xu wrote: > On Tue, Feb 06, 2024 at 08:53:45AM +0000, Daniel P. Berrangé wrote: > > AFAICS, it is not ovewriting 'p->thread' because at the time when the > > TLS thread is created, the main 'send thread' has not yet been > > created. The TLS thread and send thread execution times are mutually > > exclusive. > > IIUC it'll be overwritten after the tls handshake, where in the tls thread > uses multifd_channel_connect() to create the ultimate multifd thread with > the same p->thread variable: > > qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, > QEMU_THREAD_JOINABLE); > > There it'll overwrite the old value setup by p->thread, hence the tls > thread resource should be leaked until QEMU quits when created with > JOINABLE in both contexts.
Ah yes, missed that, you're right. 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 :|