Join the worker thread no matter if it is running or zombie already.
With current implementation the thread is joined iff @running is true.
However, when worker executes the last line, @running is set to false.
Hence qemuMonitorTestFree() won't join it (and free resources) even
though we can clearly see worker has run (nobody else sets @running =
false).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
bool json;
bool quit;
bool running;
+ bool started;
char *incoming;
size_t incomingLength;
virObjectUnref(test->vm);
- if (test->running)
+ if (test->started)
virThreadJoin(&test->thread);
if (timer != -1)
virMutexUnlock(&test->lock);
goto error;
}
- test->running = true;
+ test->started = test->running = true;
virMutexUnlock(&test->lock);
return 0;