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 <jjongsma@redhat.com>
This commit is contained in:
Frediano Ziglio 2015-08-04 16:05:38 +01:00 committed by Christophe Fergeau
parent 2862f0820d
commit aa09f04717

View File

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