From aa09f04717a7c29c29dd302717816b3a8eda3168 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Tue, 4 Aug 2015 16:05:38 +0100 Subject: [PATCH] dcc: do not cause problem with multiple threads. With multiple cards configured you can have multiple workers running in different thread. With such configuration static variables not syncronized could lead to undefined behavior. Acked-by: Jonathon Jongsma --- server/red_worker.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index 57ba5a91..1309592c 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -7171,9 +7171,8 @@ static void red_pipe_replace_rendered_drawables_with_images(RedWorker *worker, int first_surface_id, SpiceRect *first_area) { - /* TODO: can't have those statics with multiple clients */ - static int resent_surface_ids[MAX_PIPE_SIZE]; - static SpiceRect resent_areas[MAX_PIPE_SIZE]; // not pointers since drawbales may be released + int resent_surface_ids[MAX_PIPE_SIZE]; + SpiceRect resent_areas[MAX_PIPE_SIZE]; // not pointers since drawables may be released int num_resent; PipeItem *pipe_item; Ring *pipe;