+    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

Reply via email to