summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-11-07 12:38:31 +0200
committerAlon Levy <alevy@redhat.com>2010-11-07 12:38:31 +0200
commit0a1c9019b019d8b553d779efe72d9b6140456180 (patch)
tree0a9a7619c83e6a2a5179ba91f17d9ead42e0f2e0
parent40b2e48daf7eb13be23cf7dfa0bbde14d6e7397d (diff)
downloadspice-0a1c9019b019d8b553d779efe72d9b6140456180.tar.gz
spice-0a1c9019b019d8b553d779efe72d9b6140456180.tar.xz
spice-0a1c9019b019d8b553d779efe72d9b6140456180.zip
server/red_channel: add red_channel_pipe_add_after (from red_worker)
-rw-r--r--server/red_channel.c8
-rw-r--r--server/red_channel.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index 7a80862c..6f4d588b 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -514,6 +514,14 @@ void red_channel_pipe_add_push(RedChannel *channel, PipeItem *item)
red_channel_push(channel);
}
+void red_channel_pipe_add_after(RedChannel *channel, PipeItem *item, PipeItem *pos)
+{
+ ASSERT(channel && pos);
+
+ channel->pipe_size++;
+ ring_add_after(&item->link, &pos->link);
+}
+
int red_channel_pipe_item_is_linked(RedChannel *channel, PipeItem *item)
{
return ring_item_is_linked(&item->link);
diff --git a/server/red_channel.h b/server/red_channel.h
index 65064c42..3e85f9f1 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -219,6 +219,7 @@ void red_channel_begin_send_message(RedChannel *channel);
void red_channel_pipe_item_init(RedChannel *channel, PipeItem *item, int type);
void red_channel_pipe_add_push(RedChannel *channel, PipeItem *item);
void red_channel_pipe_add(RedChannel *channel, PipeItem *item);
+void red_channel_pipe_add_after(RedChannel *channel, PipeItem *item, PipeItem *pos);
int red_channel_pipe_item_is_linked(RedChannel *channel, PipeItem *item);
void red_channel_pipe_item_remove(RedChannel *channel, PipeItem *item);
void red_channel_pipe_add_tail(RedChannel *channel, PipeItem *item);