From ea26be116ab1e93871ccbfbb1267137f4d0ce47f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 10 Feb 2017 06:56:39 +0200 Subject: fix race issue in threaded test pattern draw --- kms++util/src/testpat.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'kms++util/src') diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp index 519f960..6cb5d85 100644 --- a/kms++util/src/testpat.cpp +++ b/kms++util/src/testpat.cpp @@ -155,6 +155,10 @@ static void draw_test_pattern_impl(IMappedFramebuffer& fb) return; } + // Create the mmaps before starting the threads + for (unsigned i = 0; i < fb.num_planes(); ++i) + fb.map(0); + unsigned num_threads = thread::hardware_concurrency(); vector workers; -- cgit v1.2.3