summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorUri Lublin <uril@redhat.com>2013-07-04 19:50:27 +0300
committerUri Lublin <uril@redhat.com>2013-07-16 23:37:26 +0300
commit1960ebb5b391a9633d892c80f84146cdd2c81082 (patch)
tree0dac66459b3a7e6260fd19845fcc719e39f1055c /server
parentcf905b7b68605a19d5af7660b89b40a5b6d90ac3 (diff)
downloadspice-1960ebb5b391a9633d892c80f84146cdd2c81082.tar.gz
spice-1960ebb5b391a9633d892c80f84146cdd2c81082.tar.xz
spice-1960ebb5b391a9633d892c80f84146cdd2c81082.zip
red_channel: replace RING_FOREACH with RING_FOREACH_SAFE in some places
This was originally intended to fix the problem fixed by commit 53488f0275d6c8a121af49f7ac817d09ce68090d. What is left are FOREACH loops that are at less risk and maybe safe (no read/write or disconnect/destroy are called from within them).
Diffstat (limited to 'server')
-rw-r--r--server/red_channel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index 8742008d..85d7ebce 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -2025,7 +2025,7 @@ void red_client_set_main(RedClient *client, MainChannelClient *mcc) {
void red_client_semi_seamless_migrate_complete(RedClient *client)
{
- RingItem *link;
+ RingItem *link, *next;
pthread_mutex_lock(&client->lock);
if (!client->during_target_migrate || client->seamless_migrate) {
@@ -2034,7 +2034,7 @@ void red_client_semi_seamless_migrate_complete(RedClient *client)
return;
}
client->during_target_migrate = FALSE;
- RING_FOREACH(link, &client->channels) {
+ RING_FOREACH_SAFE(link, next, &client->channels) {
RedChannelClient *rcc = SPICE_CONTAINEROF(link, RedChannelClient, client_link);
if (rcc->latency_monitor.timer) {
@@ -2073,12 +2073,12 @@ static void red_channel_pipes_create_batch(RedChannel *channel,
new_pipe_item_t creator, void *data,
rcc_item_t callback)
{
- RingItem *link;
+ RingItem *link, *next;
RedChannelClient *rcc;
PipeItem *item;
int num = 0;
- RING_FOREACH(link, &channel->clients) {
+ RING_FOREACH_SAFE(link, next, &channel->clients) {
rcc = SPICE_CONTAINEROF(link, RedChannelClient, channel_link);
item = (*creator)(rcc, data, num++);
if (callback) {