On Mon, Sep 25, 2017 at 02:37:28PM +0800, Peter Xu wrote: > So that internal iothread users can explicitly stop one iothread without > destroying it. > > Since at it, fix iothread_stop() to allow it to be called multiple > times. Before this patch we may call iothread_stop() more than once on > single iothread, while that may not be correct since qemu_thread_join() > is not allowed to run twice. From manual of pthread_join(): > > Joining with a thread that has previously been joined results in > undefined behavior. > > Signed-off-by: Peter Xu <pet...@redhat.com> > --- > include/sysemu/iothread.h | 1 + > iothread.c | 24 ++++++++++++++++-------- > 2 files changed, 17 insertions(+), 8 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>