diff --git a/src/examples/AnimateMasking.cpp b/src/examples/AnimateMasking.cpp index 0436385f..078f9151 100644 --- a/src/examples/AnimateMasking.cpp +++ b/src/examples/AnimateMasking.cpp @@ -176,6 +176,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Arc.cpp b/src/examples/Arc.cpp index 850ffc84..e1bd5e3b 100644 --- a/src/examples/Arc.cpp +++ b/src/examples/Arc.cpp @@ -172,6 +172,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Async.cpp b/src/examples/Async.cpp index 2b067cf8..0ddcd220 100644 --- a/src/examples/Async.cpp +++ b/src/examples/Async.cpp @@ -175,6 +175,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Blending.cpp b/src/examples/Blending.cpp index 8015e0d3..cd4d2362 100644 --- a/src/examples/Blending.cpp +++ b/src/examples/Blending.cpp @@ -155,6 +155,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Boundary.cpp b/src/examples/Boundary.cpp index 88ca7b97..a42cca2b 100644 --- a/src/examples/Boundary.cpp +++ b/src/examples/Boundary.cpp @@ -144,6 +144,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/ClipPath.cpp b/src/examples/ClipPath.cpp index 57e6234e..a780b386 100644 --- a/src/examples/ClipPath.cpp +++ b/src/examples/ClipPath.cpp @@ -235,6 +235,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/CustomTransform.cpp b/src/examples/CustomTransform.cpp index 9a75e8b9..3c6bdeeb 100644 --- a/src/examples/CustomTransform.cpp +++ b/src/examples/CustomTransform.cpp @@ -201,6 +201,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/DirectUpdate.cpp b/src/examples/DirectUpdate.cpp index e72d1b6a..2ed97bb7 100644 --- a/src/examples/DirectUpdate.cpp +++ b/src/examples/DirectUpdate.cpp @@ -174,6 +174,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Duplicate.cpp b/src/examples/Duplicate.cpp index 1c9333d4..580e3a07 100644 --- a/src/examples/Duplicate.cpp +++ b/src/examples/Duplicate.cpp @@ -222,6 +222,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/FillRule.cpp b/src/examples/FillRule.cpp index dda6f359..8449fa14 100644 --- a/src/examples/FillRule.cpp +++ b/src/examples/FillRule.cpp @@ -138,6 +138,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/GradientStroke.cpp b/src/examples/GradientStroke.cpp index 87ccb99b..60b81cea 100644 --- a/src/examples/GradientStroke.cpp +++ b/src/examples/GradientStroke.cpp @@ -208,6 +208,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/GradientTransform.cpp b/src/examples/GradientTransform.cpp index eb46bf14..345bb7d8 100644 --- a/src/examples/GradientTransform.cpp +++ b/src/examples/GradientTransform.cpp @@ -229,6 +229,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/InvMasking.cpp b/src/examples/InvMasking.cpp index 61ab17a1..ad186553 100644 --- a/src/examples/InvMasking.cpp +++ b/src/examples/InvMasking.cpp @@ -195,6 +195,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/LinearGradient.cpp b/src/examples/LinearGradient.cpp index fe216318..b3bdc8e8 100644 --- a/src/examples/LinearGradient.cpp +++ b/src/examples/LinearGradient.cpp @@ -173,6 +173,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Masking.cpp b/src/examples/Masking.cpp index 968ef720..6140a2b8 100644 --- a/src/examples/Masking.cpp +++ b/src/examples/Masking.cpp @@ -195,6 +195,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/MultiCanvas.cpp b/src/examples/MultiCanvas.cpp index 6bdb642c..1bd6150c 100644 --- a/src/examples/MultiCanvas.cpp +++ b/src/examples/MultiCanvas.cpp @@ -215,6 +215,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/MultiShapes.cpp b/src/examples/MultiShapes.cpp index 9902604c..64cc1308 100644 --- a/src/examples/MultiShapes.cpp +++ b/src/examples/MultiShapes.cpp @@ -133,6 +133,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Opacity.cpp b/src/examples/Opacity.cpp index ff2bf7f5..35bfc9cf 100644 --- a/src/examples/Opacity.cpp +++ b/src/examples/Opacity.cpp @@ -189,6 +189,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Path.cpp b/src/examples/Path.cpp index eaf1ddf8..535ff9fd 100644 --- a/src/examples/Path.cpp +++ b/src/examples/Path.cpp @@ -150,6 +150,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/PathCopy.cpp b/src/examples/PathCopy.cpp index 716ab5e0..69281a38 100644 --- a/src/examples/PathCopy.cpp +++ b/src/examples/PathCopy.cpp @@ -187,6 +187,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/PixelImage.cpp b/src/examples/PixelImage.cpp index 72c95dd8..e65087ad 100644 --- a/src/examples/PixelImage.cpp +++ b/src/examples/PixelImage.cpp @@ -154,6 +154,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/RadialGradient.cpp b/src/examples/RadialGradient.cpp index 3f8dfde2..101e5144 100644 --- a/src/examples/RadialGradient.cpp +++ b/src/examples/RadialGradient.cpp @@ -173,6 +173,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Scene.cpp b/src/examples/Scene.cpp index d4a5db35..4b047722 100644 --- a/src/examples/Scene.cpp +++ b/src/examples/Scene.cpp @@ -180,6 +180,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/SceneTransform.cpp b/src/examples/SceneTransform.cpp index 2db9de7f..82728598 100644 --- a/src/examples/SceneTransform.cpp +++ b/src/examples/SceneTransform.cpp @@ -225,6 +225,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Shape.cpp b/src/examples/Shape.cpp index 23a949a3..de6fc4f7 100644 --- a/src/examples/Shape.cpp +++ b/src/examples/Shape.cpp @@ -123,6 +123,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Stacking.cpp b/src/examples/Stacking.cpp index 871b42f4..afae969a 100644 --- a/src/examples/Stacking.cpp +++ b/src/examples/Stacking.cpp @@ -190,6 +190,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Stress.cpp b/src/examples/Stress.cpp index 62041c6f..862b6afe 100644 --- a/src/examples/Stress.cpp +++ b/src/examples/Stress.cpp @@ -202,6 +202,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Stroke.cpp b/src/examples/Stroke.cpp index 783efbcf..4837ace2 100644 --- a/src/examples/Stroke.cpp +++ b/src/examples/Stroke.cpp @@ -181,6 +181,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/StrokeLine.cpp b/src/examples/StrokeLine.cpp index c138ecf2..dbc94d60 100644 --- a/src/examples/StrokeLine.cpp +++ b/src/examples/StrokeLine.cpp @@ -255,6 +255,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Svg.cpp b/src/examples/Svg.cpp index 74a30490..33cb9825 100644 --- a/src/examples/Svg.cpp +++ b/src/examples/Svg.cpp @@ -163,6 +163,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Svg2.cpp b/src/examples/Svg2.cpp index f2fc8255..db823697 100644 --- a/src/examples/Svg2.cpp +++ b/src/examples/Svg2.cpp @@ -130,6 +130,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Transform.cpp b/src/examples/Transform.cpp index 3ab896a8..2466c301 100644 --- a/src/examples/Transform.cpp +++ b/src/examples/Transform.cpp @@ -192,6 +192,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) { diff --git a/src/examples/Update.cpp b/src/examples/Update.cpp index 2875066a..981e95a1 100644 --- a/src/examples/Update.cpp +++ b/src/examples/Update.cpp @@ -153,6 +153,7 @@ int main(int argc, char **argv) //Threads Count auto threads = std::thread::hardware_concurrency(); + if (threads > 0) --threads; //Allow the designated main thread capacity //Initialize ThorVG Engine if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) {