/* * drawing from multiple contexts in separate threads on a single unguarded surface */ #include "test.h" #include "tinycthread.h" #define THREAD_COUNT 32 static int finishedThreadCount = 0; static mtx_t* pmutex; void drawRandomRect (VkvgContext ctx, float s) { float w = (float)test_width; float h = (float)test_height; randomize_color(ctx); float x = truncf(w*rndf()); float y = truncf(h*rndf()); vkvg_rectangle(ctx, x, y, s, s); } int drawRectsThread () { VkvgContext ctx = vkvg_create(surf); for (uint32_t i=0; i