From patchwork Fri Feb 4 08:05:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3, 01/16] vnc: qemu can die if the client is disconnected while updating screen Date: Thu, 03 Feb 2011 22:05:53 -0000 From: Corentin Chary X-Patchwork-Id: 81815 Message-Id: <1296806768-27787-2-git-send-email-corentincj@iksaif.net> To: Anthony Liguori Cc: Corentin Chary , Andre Przywara , Qemu-development List , Alexander Graf agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing in vnc_disconnect_finish(). It's because vnc_worker_thread_loop() tries to unlock the mutex while not locked. The unlocking call doesn't fail (pthread bug ?), but the destroy call does. Signed-off-by: Corentin Chary --- ui/vnc-jobs-async.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c index 6e9cf08..0b5d750 100644 --- a/ui/vnc-jobs-async.c +++ b/ui/vnc-jobs-async.c @@ -227,6 +227,10 @@ static int vnc_worker_thread_loop(VncJobQueue *queue) if (job->vs->csock == -1) { vnc_unlock_display(job->vs->vd); + /* output mutex must be locked before going to + * disconnected: + */ + vnc_lock_output(job->vs); goto disconnected; }