From 1955d08f1be26c9398f19e50f52d3c6d18a111bb Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Tue, 24 Aug 2010 21:18:58 +0000 Subject: [PATCH] Fix parallel collision dispatch for PTHREADS version of BenchmarkDemo. Thanks to shankargiri for the patch and report in Issue 418 --- Demos/Benchmarks/BenchmarkDemo.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Demos/Benchmarks/BenchmarkDemo.cpp b/Demos/Benchmarks/BenchmarkDemo.cpp index 3b6dad02f..d85600b55 100644 --- a/Demos/Benchmarks/BenchmarkDemo.cpp +++ b/Demos/Benchmarks/BenchmarkDemo.cpp @@ -39,7 +39,11 @@ subject to the following restrictions: #ifdef USE_PARALLEL_DISPATCHER_BENCHMARK +#ifdef _WIN32 #include "BulletMultiThreaded/Win32ThreadSupport.h" +#elif defined (USE_PTHREADS) +#include "BulletMultiThreaded/PosixThreadSupport.h" +#endif #include "BulletMultiThreaded/SpuGatheringCollisionDispatcher.h" #include "BulletMultiThreaded/btParallelConstraintSolver.h" @@ -328,7 +332,12 @@ void BenchmarkDemo::initPhysics() #if USE_PARALLEL_DISPATCHER_BENCHMARK int maxNumOutstandingTasks = 4; +#ifdef _WIN32 Win32ThreadSupport* threadSupportCollision = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo( "collision",processCollisionTask, createCollisionLocalStoreMemory,maxNumOutstandingTasks)); +#elif defined (USE_PTHREADS) + PosixThreadSupport::ThreadConstructionInfo collisionConstructionInfo( "collision",processCollisionTask, createCollisionLocalStoreMemory,maxNumOutstandingTasks); + PosixThreadSupport* threadSupportCollision = new PosixThreadSupport(collisionConstructionInfo); +#endif //SequentialThreadSupport::SequentialThreadConstructionInfo sci("spuCD", processCollisionTask, createCollisionLocalStoreMemory); //SequentialThreadSupport* seq = new SequentialThreadSupport(sci); m_dispatcher = new SpuGatheringCollisionDispatcher(threadSupportCollision,1,m_collisionConfiguration);