server/red_channel: add red_channel_pipe_add_after (from red_worker)

This commit is contained in:
Alon Levy 2010-11-07 12:38:31 +02:00
parent 23f37df548
commit c322873cf0
2 changed files with 11 additions and 0 deletions

View File

@ -520,6 +520,16 @@ 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);
ASSERT(pos);
ASSERT(item);
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);

View File

@ -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);