summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-09-08 16:48:29 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2011-10-13 19:14:07 +0200
commit0fbeb331f588efb7a744cc9a3bf3024c087f4cc4 (patch)
tree53ba602ffebd5c13a9caf0f48ad1536437ebf5c6
parent9a19d4eba55e2fe27eb20f614472e08f00da5494 (diff)
drawble instancemulticlient
-rw-r--r--server/red_worker.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 4aed4583..93afa431 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -542,6 +542,7 @@ typedef struct RedGlzDrawable RedGlzDrawable;
*/
typedef struct GlzDrawableInstanceItem {
RingItem free_link;
+ LIST_ENTRY(GlzDrawableInstanceItem) xx_free_link;
GlzEncDictImageContext *glz_instance;
RedGlzDrawable *red_glz_drawable;
LIST_ENTRY(GlzDrawableInstanceItem) glz_link;
@@ -622,6 +623,7 @@ struct DisplayChannelClient {
Ring glz_drawables; // all the living lz drawable, ordered by encoding time
Ring glz_drawables_inst_to_free; // list of instances to be freed
+ LIST_HEAD (,GlzDrawableInstanceItem) xx_glz_drawables_inst_to_free;
pthread_mutex_t glz_drawables_inst_to_free_lock;
uint8_t surface_client_created[NUM_SURFACES];
@@ -5024,16 +5026,14 @@ static void red_display_free_glz_drawable_instance(DisplayChannelClient *dcc,
static void red_display_handle_glz_drawables_to_free(DisplayChannelClient* dcc)
{
- RingItem *ring_link;
+ GlzDrawableInstanceItem *drawable_instance;
+ GlzDrawableInstanceItem *next;
if (!dcc->glz_dict) {
return;
}
pthread_mutex_lock(&dcc->glz_drawables_inst_to_free_lock);
- while ((ring_link = ring_get_head(&dcc->glz_drawables_inst_to_free))) {
- GlzDrawableInstanceItem *drawable_instance = SPICE_CONTAINEROF(ring_link,
- GlzDrawableInstanceItem,
- free_link);
+ LIST_FOREACH_SAFE(drawable_instance, &dcc->xx_glz_drawables_inst_to_free, xx_free_link, next) {
red_display_free_glz_drawable_instance(dcc, drawable_instance);
}
pthread_mutex_unlock(&dcc->glz_drawables_inst_to_free_lock);
@@ -5364,8 +5364,8 @@ static void glz_usr_free_image(GlzEncoderUsrContext *usr, GlzUsrImageContext *im
* this check.
*/
pthread_mutex_lock(&drawable_cc->glz_drawables_inst_to_free_lock);
- ring_add_before(&glz_drawable_instance->free_link,
- &drawable_cc->glz_drawables_inst_to_free);
+ LIST_INSERT_HEAD(&drawable_cc->xx_glz_drawables_inst_to_free,
+ glz_drawable_instance, xx_free_link);
pthread_mutex_unlock(&drawable_cc->glz_drawables_inst_to_free_lock);
}
}
@@ -9137,7 +9137,7 @@ static int display_channel_init_glz_dictionary(DisplayChannelClient *dcc,
{
ASSERT(!dcc->glz_dict);
ring_init(&dcc->glz_drawables);
- ring_init(&dcc->glz_drawables_inst_to_free);
+ LIST_INIT(&dcc->xx_glz_drawables_inst_to_free);
pthread_mutex_init(&dcc->glz_drawables_inst_to_free_lock, NULL);
return !!(dcc->glz_dict = red_get_glz_dictionary(dcc,
init_info->glz_dictionary_id,
@@ -9155,7 +9155,7 @@ static int display_channel_handle_migrate_glz_dictionary(DisplayChannelClient *d
{
ASSERT(!dcc->glz_dict);
ring_init(&dcc->glz_drawables);
- ring_init(&dcc->glz_drawables_inst_to_free);
+ LIST_INIT(&dcc->xx_glz_drawables_inst_to_free);
pthread_mutex_init(&dcc->glz_drawables_inst_to_free_lock, NULL);
return !!(dcc->glz_dict = red_restore_glz_dictionary(dcc,
migrate_info->glz_dict_id,