Fabiano Rosas <faro...@suse.de> wrote: > Fabiano Rosas <faro...@suse.de> writes: > >> Peter Xu <pet...@redhat.com> writes: >> >>> On Thu, Nov 09, 2023 at 01:58:56PM -0300, Fabiano Rosas wrote:
>> I think we historically stumbled upon the fact that qemu_thread_join() >> is not the same as pthread_join(). The former takes a pointer and is not >> safe to call with a NULL QemuThread. That seems to be the reason for the >> p->running check before it. > > Scratch this part, the QemuThread is not a pointer. > > ...should it be? Because then we can test p->thread instead of > p->running, which would be more precise and would dispense the > thread_created flag. You still need to make sure that you don't join the thread twice. And we do the qemu_pthread_join() without any lock. Later, Juan.