Mark cairo surface as dirty from final worker thread
This commit is contained in:
parent
270c00cefc
commit
7f73925769
1 changed files with 11 additions and 0 deletions
11
visor.c
11
visor.c
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue