diff options
author | Alon Levy <alevy@redhat.com> | 2010-11-07 14:05:19 +0200 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2011-02-11 15:32:20 +0200 |
commit | e8698ea0f89f797fcfb34c192486f636e677f3b2 (patch) | |
tree | d0c9f3b7797272ded1aab4369308bc62ecc1516f /server/red_client_shared_cache.h | |
parent | 9330dbac13ccec52f32e06169c746f99086e464a (diff) | |
download | spice-e8698ea0f89f797fcfb34c192486f636e677f3b2.tar.gz spice-e8698ea0f89f797fcfb34c192486f636e677f3b2.tar.xz spice-e8698ea0f89f797fcfb34c192486f636e677f3b2.zip |
server/red_worker: introduce CommonChannel
with everything (almost) not in red_channel's RedChannel
As a result of CommonChannel a free cb is added to EventHandler,
to take care of non zero offset for embedded EventHandler.
Diffstat (limited to 'server/red_client_shared_cache.h')
-rw-r--r-- | server/red_client_shared_cache.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/server/red_client_shared_cache.h b/server/red_client_shared_cache.h index 716b8122..4d50fe4f 100644 --- a/server/red_client_shared_cache.h +++ b/server/red_client_shared_cache.h @@ -48,9 +48,9 @@ static int FUNC_NAME(hit)(CACHE *cache, uint64_t id, int *lossy, CHANNEL *channe if (item->id == id) { ring_remove(&item->lru_link); ring_add(&cache->lru, &item->lru_link); - ASSERT(channel->base.id < MAX_CACHE_CLIENTS) - item->sync[channel->base.id] = serial; - cache->sync[channel->base.id] = serial; + ASSERT(channel->common.id < MAX_CACHE_CLIENTS) + item->sync[channel->common.id] = serial; + cache->sync[channel->common.id] = serial; *lossy = item->lossy; break; } @@ -108,7 +108,7 @@ static int FUNC_NAME(add)(CACHE *cache, uint64_t id, uint32_t size, int lossy, C NewCacheItem **now; if (!(tail = (NewCacheItem *)ring_get_tail(&cache->lru)) || - tail->sync[channel->base.id] == serial) { + tail->sync[channel->common.id] == serial) { cache->available += size; pthread_mutex_unlock(&cache->lock); free(item); @@ -127,7 +127,7 @@ static int FUNC_NAME(add)(CACHE *cache, uint64_t id, uint32_t size, int lossy, C ring_remove(&tail->lru_link); cache->items--; cache->available += tail->size; - cache->sync[channel->base.id] = serial; + cache->sync[channel->common.id] = serial; display_channel_push_release(channel, SPICE_RES_TYPE_PIXMAP, tail->id, tail->sync); free(tail); } @@ -140,8 +140,8 @@ static int FUNC_NAME(add)(CACHE *cache, uint64_t id, uint32_t size, int lossy, C item->size = size; item->lossy = lossy; memset(item->sync, 0, sizeof(item->sync)); - item->sync[channel->base.id] = serial; - cache->sync[channel->base.id] = serial; + item->sync[channel->common.id] = serial; + cache->sync[channel->common.id] = serial; pthread_mutex_unlock(&cache->lock); return TRUE; } @@ -177,13 +177,13 @@ static void FUNC_NAME(reset)(CACHE *cache, CHANNEL *channel, SpiceMsgWaitForChan PRIVATE_FUNC_NAME(clear)(cache); channel->CACH_GENERATION = ++cache->generation; - cache->generation_initiator.client = channel->base.id; + cache->generation_initiator.client = channel->common.id; cache->generation_initiator.message = serial; - cache->sync[channel->base.id] = serial; + cache->sync[channel->common.id] = serial; wait_count = 0; for (i = 0; i < MAX_CACHE_CLIENTS; i++) { - if (cache->sync[i] && i != channel->base.id) { + if (cache->sync[i] && i != channel->common.id) { sync_data->wait_list[wait_count].channel_type = SPICE_CHANNEL_DISPLAY; sync_data->wait_list[wait_count].channel_id = i; sync_data->wait_list[wait_count++].message_serial = cache->sync[i]; |