aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc-jobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui/vnc-jobs.c')
-rw-r--r--ui/vnc-jobs.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index 087b84d..57c0916 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -33,21 +33,21 @@
/*
* Locking:
*
- * There is three levels of locking:
+ * There are three levels of locking:
* - jobs queue lock: for each operation on the queue (push, pop, isEmpty?)
* - VncDisplay global lock: mainly used for framebuffer updates to avoid
* screen corruption if the framebuffer is updated
- * while the worker is doing something.
+ * while the worker is doing something.
* - VncState::output lock: used to make sure the output buffer is not corrupted
- * if two threads try to write on it at the same time
+ * if two threads try to write on it at the same time
*
- * While the VNC worker thread is working, the VncDisplay global lock is hold
- * to avoid screen corruptions (this does not block vnc_refresh() because it
- * uses trylock()) but the output lock is not hold because the thread work on
+ * While the VNC worker thread is working, the VncDisplay global lock is held
+ * to avoid screen corruption (this does not block vnc_refresh() because it
+ * uses trylock()) but the output lock is not held because the thread works on
* its own output buffer.
* When the encoding job is done, the worker thread will hold the output lock
* and copy its output buffer in vs->output.
-*/
+ */
struct VncJobQueue {
QemuCond cond;
@@ -62,7 +62,7 @@ typedef struct VncJobQueue VncJobQueue;
/*
* We use a single global queue, but most of the functions are
- * already reetrant, so we can easilly add more than one encoding thread
+ * already reentrant, so we can easily add more than one encoding thread
*/
static VncJobQueue *queue;
@@ -187,7 +187,8 @@ static void vnc_async_encoding_start(VncState *orig, VncState *local)
local->vd = orig->vd;
local->lossy_rect = orig->lossy_rect;
local->write_pixels = orig->write_pixels;
- local->clientds = orig->clientds;
+ local->client_pf = orig->client_pf;
+ local->client_be = orig->client_be;
local->tight = orig->tight;
local->zlib = orig->zlib;
local->hextile = orig->hextile;
@@ -320,6 +321,11 @@ static void *vnc_worker_thread(void *arg)
return NULL;
}
+static bool vnc_worker_thread_running(void)
+{
+ return queue; /* Check global queue */
+}
+
void vnc_start_worker_thread(void)
{
VncJobQueue *q;
@@ -332,11 +338,6 @@ void vnc_start_worker_thread(void)
queue = q; /* Set global queue */
}
-bool vnc_worker_thread_running(void)
-{
- return queue; /* Check global queue */
-}
-
void vnc_stop_worker_thread(void)
{
if (!vnc_worker_thread_running())