From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58537 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKY5R-00015w-Fe for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:41:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKY5M-00089a-P1 for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:41:29 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:65128) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKY5M-00089V-KJ for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:41:24 -0400 Received: by wyb36 with SMTP id 36so965838wyb.4 for ; Fri, 04 Jun 2010 07:41:23 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4C09108F.4080004@redhat.com> Date: Fri, 04 Jun 2010 16:41:19 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1275657620-26226-1-git-send-email-corentincj@iksaif.net> <1275657620-26226-3-git-send-email-corentincj@iksaif.net> In-Reply-To: <1275657620-26226-3-git-send-email-corentincj@iksaif.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2 2/2] vnc: threaded VNC server List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corentin Chary Cc: Anthony Liguori , Gautham R Shenoy , Qemu-development List , Alexander Graf > + vnc_lock_queue(queue); > + if (QTAILQ_EMPTY(&queue->jobs)) { > + qemu_cond_wait(&queue->cond,&queue->mutex); > + } > + > + /* If the queue is empty, it's an exit order */ > + if (QTAILQ_EMPTY(&queue->jobs)) { > + vnc_unlock_queue(queue); > + return -1; > + } > + > + job = QTAILQ_FIRST(&queue->jobs); > + vnc_unlock_queue(queue); Wrong usage of condition variables... > + flush = (job->vs->csock != -1&& job->vs->abording != true); and typo still there. > +static void *vnc_worker_thread(void *arg) > +{ > + VncJobQueue *queue = arg; Also, it's better (future proof) to call qemu_thread_self here. Thanks! Paolo