[Spice-devel] [PATCH 08/24] server/red_channel: add red_channel_pipe_add_after (from red_worker)
Alon Levy
alevy at redhat.com
Wed Jan 19 10:07:54 PST 2011
---
server/red_channel.c | 8 ++++++++
server/red_channel.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/server/red_channel.c b/server/red_channel.c
index 9b25f0a..68dfe9f 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -520,6 +520,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 08550a1..2bb611f 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -216,6 +216,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);
--
1.7.3.4
More information about the Spice-devel
mailing list