Mark cairo surface as dirty from final worker thread

This commit is contained in:
Petar Kapriš 2025-10-13 21:09:11 +02:00
parent 270c00cefc
commit 7f73925769

11
visor.c
View file

@ -119,7 +119,18 @@ void draw_mandelbrot(struct threadInfo *info)
pixmap[4*(i*w + j) + 0] = b;
}
}
pthread_mutex_lock(&pixmapMutex);
info->complete = true;
bool allWritersComplete = true;
for (int32_t i = 0; i < thread_count; i++) {
if (!threads[i].complete) {
allWritersComplete = false;
}
}
if (allWritersComplete) {
cairo_surface_mark_dirty(surface);
}
pthread_mutex_unlock(&pixmapMutex);
}
#define MAX_ITERATION 1000