From bbae44fec77cd71217c77e6937bceda8d3b3b437 Mon Sep 17 00:00:00 2001 From: neingeist Date: Sun, 11 May 2014 11:44:47 +0200 Subject: [PATCH] only SDL_Flip is critical, not the check --- mandelbrot-openmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mandelbrot-openmp.c b/mandelbrot-openmp.c index 8b36a89..951b6a5 100644 --- a/mandelbrot-openmp.c +++ b/mandelbrot-openmp.c @@ -53,9 +53,9 @@ void drawmandelbrot(SDL_Surface * surface) { pixels[i] = color; /* Update the screen every 10 lines. */ - #pragma omp critical - { - if (y % 10 == 0 && x == 0) { + if (y % 10 == 0 && x == 0) { + #pragma omp critical + { SDL_Flip(surface); } }